Macro loop Copy paste in a column with diff¸erent range each time

cbdunnigan

New Member
Joined
Nov 19, 2019
Messages
6
Hi,

I have a long list of names that are separated by a different number of empty lines inbetween each other. I need to copy and paste until the next name.
Anyone can help me doing this loop copy=paste macro?

Example, this:
1574192718071.png


should become:
1574192731889.png

Thank you,
Colin
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
What determines how many times you copy the last value in the list?
 
Upvote 0
What about the last name?
 
Upvote 0
That's over a million rows :eek:
Is there another column that dictates the last used row in the sheet?
 
Upvote 0
Ok, try this
Rich (BB code):
Sub cbdunnigan()
    With Range("B1:B" & Range("A" & Rows.Count).End(xlUp).Row)
        .SpecialCells(xlBlanks).FormulaR1C1 = "=r[-1]c"
        .Value = .Value
    End With
End Sub
Change the two Bs in green to match the column you want this to work on.
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,391
Members
449,080
Latest member
Armadillos

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
Back
Top