Macro required - Filling in blanks

walker2011au

New Member
Joined
Jun 9, 2011
Messages
10
Hi Guys, wondering if you could help me with a macro, or if there is a way to apply a formula to do the same.. It would be okay if it was only a few records I could just drag date down etc, but its 30,000 lines..
So need a macro to copy the date until a new one is found and stop..


Current Data:

|Payment Date| |Reference|
12-09-2007---- 1
----------------2
----------------3
----------------4
13-09-2007 ----5
----------------6
----------------7

Desired Result:

|Payment Date|-|Reference|
12-09-2007 -----1
12-09-2007 -----2
12-09-2007 -----3
12-09-2007 -----4
13-09-2007 -----5
13-09-2007 -----6
13-09-2007 -----7


Cheers! :beerchug:
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
1. Select column with Payment Day.
2. F5.
3. Special...
4. Blanks.
5. Write formula: =A1 (where A1 is the first cell with data in Payment Day).
6. Ctrl+Enter.
 
Upvote 0
Code:
Sub FillEm()
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
With Range("A1:A" & LR)
    .SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
    .Value = .Value
End With
End Sub

Try this on a copy of your workbook.
 
Upvote 0
Code:
Sub FillEm()
Dim LR As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
With Range("A1:A" & LR)
    .SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=R[-1]C"
    .Value = .Value
End With
End Sub

Try this on a copy of your workbook.

works a treat! much appreciated.

Thanks sektor, doesnt quite do what I needed, but handy to know, will use the f5 blank selector in future for sure.
 
Upvote 0

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

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