Copy down

edsjr

New Member
Joined
Mar 27, 2002
Messages
33
I have a large spreadsheet (over 20k rows), in column a there is a company name and then many empty rows next to it. I need something that will fill down until it gets to a new name and then fill down again. see example, column a is original and i need it to be like column b

thanks in advance

Ed.

PS, I can't post attachment....how do I do that?

Here is a link to the file https://1drv.ms/x/s!AlMKyRBHlUsBgcgCRG-tFLFp64rdNg
 
Last edited:

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
56,614
Office Version
  1. 365
Platform
  1. Windows
How about
Code:
Sub edsjr()
   With Range("A1", Range("B" & Rows.Count).End(xlUp).Offset(-1))
      .SpecialCells(xlBlanks).FormulaR1C1 = "=r[-1]c"
      .Value = .Value
   End With
End Sub
This site does not allow members to upload files. You either upload to a share site, or you can use one of the add-ins available here to post data direct to the thread https://www.mrexcel.com/forum/about-board/508133-attachments.html
 

edsjr

New Member
Joined
Mar 27, 2002
Messages
33
I get a runtime error everytime I do it

I'll admit, I don't know much about macros

I threw the sample file on my onedrive account and made it shareable, link in original post
 
Last edited:

jtakw

Well-known Member
Joined
Jun 29, 2014
Messages
6,007
Office Version
  1. 2016
Platform
  1. Windows
Hi,

1. For your sample, at the Very Last cell in Column A where you want the copy to STOP (i.e. A43), enter Any Value ( i.e. "Stop" )
2. Enter this formula in A2,
=A1
Click Enter, select A2, right click, Copy
3. Select Column A, hit F5, click "Special", Check "Blanks", click "OK"
4. Hit Ctrl and V

You're done.

Delete the value in A43 if desired.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,570
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

I ran the code and it worked for me.
 

edsjr

New Member
Joined
Mar 27, 2002
Messages
33
what jtakw posted worked like a charm

My Aswer Is This......probably something in my security settings.

Thank you both for the help
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
17,570
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

Well that works if you do not mine all those formulas in those cells.
If you look at all the cells that earlier were empty now have a formula in them
what jtakw posted worked like a charm

My Aswer Is This......probably something in my security settings.

Thank you both for the help
 

Watch MrExcel Video

Forum statistics

Threads
1,129,685
Messages
5,637,795
Members
416,983
Latest member
LessThanAverageUser

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top