View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Macro for Fill Blank Cells Macro

Sorry, I forgot to include the error trapping. Use this code instead...

Sub FillColBlanks()
Dim Col As Variant, Data As Range, A As Range
On Error GoTo NoCellsFound
For Each Col In Array("B", "C", "E")
Set Data = Range(Cells(1, Col), Cells(Rows.Count, Col).End(xlUp))
For Each A In Data.SpecialCells(xlCellTypeBlanks).Areas
A.Value = A(1).Offset(-1).Value
Next
Next
NoCellsFound:
End Sub

Rick Rothstein (MVP - Excel)