blueice2627
New Member
- Joined
- May 21, 2018
- Messages
- 10
Hi All,
I'm trying to create a macro that will take a range from one worksheet (total of 4 columns and 14 rows), and copy it multiple times below each paste (one after another) based on the value in another cell. Essentially I am using this macro to create coupons and based on the number of coupons, it will continue to copy and paste until the correct number of coupons have been made. This is my first time doing what i think needs to be a loop statement, any help would be greatly appreciated!
What I have created so far is:
Where i am getting lost... or the end of my knowledge on this is subject... How do i make my range a variable that increments 13 rows to continue the loop?
Thanks again in advance!
I'm trying to create a macro that will take a range from one worksheet (total of 4 columns and 14 rows), and copy it multiple times below each paste (one after another) based on the value in another cell. Essentially I am using this macro to create coupons and based on the number of coupons, it will continue to copy and paste until the correct number of coupons have been made. This is my first time doing what i think needs to be a loop statement, any help would be greatly appreciated!
What I have created so far is:
Code:
Dim CopyCount As Integer
Dim Rng As Range
Dim SecondSetStart As Range
CopyCount = RepeatTimes 'This refers to the cell that has the number of times to repeat the copy/paste
For x = 1 To CopyCount
Set Rng = Range("SecondSet") 'SecondSet is the range of cells that is being copied
Set StartRng = Range("A14") 'StartRng is where the first paste will go, following pastes need to be 13 rows after this, A27, A40, etc...
Do Until x = CopyCount
Range("Rng").Select
Selection.Copy
Sheets("Coupon Printing").Select
Range("StartRng").Select
ActiveSheet.Paste
Where i am getting lost... or the end of my knowledge on this is subject... How do i make my range a variable that increments 13 rows to continue the loop?
Thanks again in advance!