View Single Post
  #2   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

I searched the macro for fill blank cells . May I know how to
modified the following macro, therefore, it can apply on
column B, C and E? Thanks

<<<code snipped


Does this code do what you want...

Sub FillColBlanks()
Dim Col As Variant, Data As Range, A As Range
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
End Sub

Rick Rothstein (MVP - Excel)