jnix612
02-24-2022, 08:34 AM
I would like to use this code to paste "X" number of times to the next empty column to the right.
It works great as is, but I now have a different need.
Sub CopyxTimes()
Dim i As Integer
Dim Rng As Range
i = InputBox("Enter no of times")
Set Rng = Selection
Set Rng = Range("a2:s12")
Rng.Copy Rng.Offset(Rng.Rows.Count).Resize(Rng.Rows.Count * i, Rng.Columns.Count)
End Sub
It works great as is, but I now have a different need.
Sub CopyxTimes()
Dim i As Integer
Dim Rng As Range
i = InputBox("Enter no of times")
Set Rng = Selection
Set Rng = Range("a2:s12")
Rng.Copy Rng.Offset(Rng.Rows.Count).Resize(Rng.Rows.Count * i, Rng.Columns.Count)
End Sub