Run a Macro in multiple selected columns

Closed
RGPX - 11 Nov 2010 à 13:14
data_encoder Posts 13 Registration date Wednesday 3 November 2010 Status Member Last seen 15 November 2010 - 12 Nov 2010 à 17:57
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 response

data_encoder Posts 13 Registration date Wednesday 3 November 2010 Status Member Last seen 15 November 2010 1
12 Nov 2010 à 17:57
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