Run a Macro in multiple selected columns

Closed
RGPX - Nov 11, 2010 at 01:14 PM
data_encoder Posts 13 Registration date Wednesday November 3, 2010 Status Member Last seen November 15, 2010 - Nov 12, 2010 at 05:57 PM
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 November 3, 2010 Status Member Last seen November 15, 2010 1
Nov 12, 2010 at 05:57 PM
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 
0