0

I am using the following code for assigning a value.

    Sheets("CDGL Data").Range("A" & Rows.Count).End(xlUp).Offset(1).Formula= "April"

I need the "April" to fill down to the rest of my adjacent rows in blank Cells among the Cells that have values in them.

Example: Cell A899 is blank, Cell B899 has a value, Cell C899 has a value "April" needs to be put into that blank cell A899.

Please help!

skkakkar
  • 2,772
  • 2
  • 17
  • 30
Hags
  • 17
  • 1
  • 1
  • 7

1 Answers1

1

You can use this:

Dim lStartRow             As Long
Dim lEndRow               As Long
With Sheets("CDGL Data")
    lStartRow = .Range("A" & .Rows.Count).End(xlUp).Row + 1
    lEndRow = Application.Max(.Range("B" & .Rows.Count).End(xlUp).Row, .Range("C" & .Rows.Count).End(xlUp).Row)
    .Range(.Cells(lStartRow, "A"), .Cells(lEndRow, "A")).Value2 = "April"
End With
Rory
  • 32,730
  • 5
  • 32
  • 35
  • For more tips on finding the last row, I suggest looking over [this thread](http://stackoverflow.com/questions/11169445/error-in-finding-last-used-cell-in-vba) – BruceWayne May 18 '16 at 15:41