Wednesday, August 28, 2013

Commonly used VBA functions

Some of the commonly used VBA functions:

To autofill using VBA Macro : 

Range("A2: A50").FillDown

To autofill till the last row:

Range("A2").End(xlDown).Row
        Range("A2: " & Range("A2").End(xlDown).Row).Select
        Selection.FillDown

To use the auto filter in macro:

ActiveSheet.Range("$A$1:$BH$65535").AutoFilter Field:=1, Criteria1:= _
        "=selection1", Operator:=xlOr, Criteria2:="=Selection2"

To insert a blank column:

Columns("F:F").Select
    Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
For more information:

No comments:

Post a Comment