Run a Macro in multiple selected columns

[Closed]
Report
-
Posts
13
Registration date
Wednesday November 3, 2010
Status
Member
Last seen
November 15, 2010
-
Hello,

i have a macro to fill in blanks. Is it possible to run it for multiple columns at the the same time.

Thanks

1 reply

Posts
13
Registration date
Wednesday November 3, 2010
Status
Member
Last seen
November 15, 2010
1
Highlight the range of cells you want the macro to run.

Sub FillAllBlanks() 
    Dim oRng As Range 
    Set oRng = Selection 
    Selection.SpecialCells(xlCellTypeBlanks).Select 
    Selection.FormulaR1C1 = "=R[-1]C" 
    oRng.Copy 
    oRng.PasteSpecial Paste:=xlValues, Operation:=xlNone, _ 
       SkipBlanks:=False, Transpose:=False 
End Sub