Vba Code

  • Thread starter Thread starter Horacio
  • Start date Start date
H

Horacio

Hi!
I´locking for a vba code that fill in a column different names.
Column A
1Today
2
3
4 Tomorrow
5
6
7
8

So what I wont is a code that fill TODAY till the row 3 and then
TOMORROW to the row 8

Thank you
Horacio
 
Give this macro a try...

Sub FillInTheBlanks()
Dim Blanks As Range, LastRow As Long
LastRow = ActiveSheet.Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row
For Each Blanks In Range("A1:A" & LastRow).SpecialCells(xlCellTypeBlanks)
Blanks.Value = Blanks(1).Offset(-1).Value
Next
End Sub
 
are you just wanting to fill down the cells with the contents of the cell
above?

For Each c In Worksheets("sheet1").Range("A2:A100")
If c.Value = "" Then c.Value = c.Offset(-1, 0)
Next

The question is at what point do you stop?
this only continues until A100
 
Back
Top