
Originally Posted by
floridagunner
Macro to Fill Blank Cell with Values above.
--------------------------------------------------------------------------------
I am using the following procedure to fill in blank cells with the value above:
Select the column with the blanks.
Goto Edit>Goto...Special and select blanks.
Goto the formula bar, enter =A1 (or whatever the first cell with data is) and then press CTRL+ENTER.
Select the column, copy and paste special values
However this does not work with what I need to do now.
What I need to do is this:
12345
~~
This means I need to fill in the blank cells with the SERIES OF VALUES immediately above the blanks.
The reason I cant use the above procedure is that the size of the series varies.
For example i will have two values followed by two blanks then 5 values followed by five Blanks.
Any help is appreciated
Thanks
Hi,
a small macro something like
Sub FillIn()
Dim iRow As Long, iLastRow As Long
iLastRow = ActiveSheet.Range("A65536").End(xlUp).Row
For iRow = 2 To iLastRow
If Cells(iRow, 1).Value < 1 Then
Cells(iRow, 1).Value = Cells(iRow - 1, 1).Value + 1
End If
Next
End Sub
should go close to that.
hth
---
Bookmarks