Thursday, September 20, 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 Err1:
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
Err1:
End Sub


Thanks,Tamatam

No comments:

Post a Comment

Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.

Featured Post from this Blog

How to compare Current Snapshot Data with Previous Snapshot in Power BI

How to Dynamically compare two Snapshots Data in Power BI Scenario: Suppose, we have a sample Sales data, which is stored with Monthly Snaps...

Popular Posts from this Blog