Thursday, 20 September 2012

Excel VBA Macro To Auto Fill A Specified Number Of Times & Copy The Same

Excel VBA Macro To Auto Fill A Specified Number Of Times & Copy The Same

Sub FillnCopy()
Dim x As Integer
Dim y As Integer
Dim z As Integer


On Error GoTo TPR:
y = InputBox("Enter The Desired No.of Times To Fill:")

For x = 1 To y - 1
z = z + 1
ActiveCell.Offset(z, 0) = ActiveCell.Value
Next x


Range(ActiveCell.Offset(z, 0), ActiveCell.Offset(z - (y - 1), 0)).Copy

TPR:
End Sub

No comments:

Post a Comment

Follow Me by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts