Wednesday, 26 September 2012

Excel VBA Macro To Auto Fill Default , Auto Fill Series

Excel VBA Macro To Auto Fill Default , Auto Fill Series

MODEL 1:
'Macro To AutoFillDefault  

'This Is A User Friendly Macro which Works Based on User Selection

Sub FillDefault()

For X = 1 To 100
Selection.AutoFill Range(ActiveCell.Offset(X, 0), ActiveCell.Offset(0, 0)), xlFillDefault
Next X

End Sub

'Macro To AutoFillSeries

'This Is A User Friendly Macro which Works Based on User Selection

Sub FillSeries()

For X = 1 To 100
Selection.AutoFill Range(ActiveCell.Offset(X, 0), ActiveCell.Offset(0, 0)), xlFillSeries
Next X

End Sub


MODEL 2:
Macro To AutoFillSeries 

Sub AutoFillSeries()

'If You Know Active Cell Then You Can AutoFillSeries As

'Syntax 1:
Cells(2, 1).AutoFill Range("A2:A100"), xlFillSeries

'Syntax 2:
Cells(2, 1).AutoFill Destination:=Range("A2:A100"), Type:=xlFillSeries

End Sub


Macro To AutoFillDefault

Sub AutoFillDefault()

'If You Know Active Cell Then You Can AutoFillDefault As

'Syntax 1:
Cells(2, 1).AutoFill Range("A2:A100"), xlFillDefault

'Syntax 2:
Cells(2, 1).AutoFill Destination:=Range("A2:A100"), Type:=xlFillDefault

End Sub

No comments:

Post a Comment

Follow Me by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts