Auto-fill empty cells with specific text

  • Thread starter Thread starter Toby
  • Start date Start date
T

Toby

Using Excel 2010.

I have text "A" in row 2, then blank spaces until row 13. Row 13 has text "B." Then I have 11 spaces until Row 24, which is text "C". I want the spaces to be filled by the preceding "label" (A, B, C).

I only wish to perform this operation on Column A while keeping all other columns locked. Thank you very much in advance!
 
or
Sub FillSelectionBlanksBelow()
Dim Cell As Range
For Each Cell In Selection
If Cell.Value = "" Then Cell.Value = Cell.Offset(-1, 0).Value
Next Cell
End Sub
 
or
Sub FillSelectionBlanksBelow()
    Dim Cell As Range
    For Each Cell In Selection
        If Cell.Value = "" Then Cell.Value = Cell.Offset(-1, 0).Value
    Next Cell
End Sub

Don - thanks so much for your help!
 
Back
Top