HELP with looping a macro

frogsplash23

New Member
Joined
Apr 11, 2011
Messages
1
Hello all,
I am struggling with how to insert the coding into an existing macro to loop it. I am not very experienced with VBA, the macro itself works great for the first row but I want it to do it for the entire range.

I have a table of data, i want to copy data within certain cells on a row on to a different sheet at ten row intervals.I want it to continue to do this until it hits an empty cell from the range on the first sheet.

For example,
Sheet 1
A B C
1 347 10 Weekly
2 348 10 Monthly
3 349 10 Weekly
4

Sheet 2
A B
10 Weekly
20 Monthly
20 Weekly


So as above it will look at Cell A1 and copy the value in C1 and paste it onto row 10 of sheet 2 it will continue to do this for this range of cells until it hits an empty cell, i.e A4.

I am aware it will likely be a Do Until formula but not sure exactly how to word it for the above.

Any help with this would be greatly appreciated

Thanks
Chris
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Try

Code:
Sub test()
Dim LR As Long, i As Long
With Sheets("Sheet1")
    LR = .Range("A" & Rows.Count).End(xlUp).Row
    For i = 1 To LR Step 10
        .Range("B" & i).Resize(, 2).Copy Destination:=Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Offset(1)
    Next i
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,991
Messages
6,122,628
Members
449,095
Latest member
bsb1122

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top