Copy and Paste Loop

JTSHOW

New Member
Joined
Mar 16, 2013
Messages
5
Hello, I need to have a macro that can copy two cells and paste them onto a separate sheet. Here's what I have so far, but nothing happens when I run it:

Sub T()
'
' T Macro
'
' Keyboard Shortcut: Ctrl+Shift+T
'
Let i = 1
Let j = 3
Do While Not IsEmpty(ActiveCell)
Range("A" + CStr(i) & ":B" + CStr(i)).Select
Selection.Copy
Sheets("Template").Select
Range("A" + CStr(j) & ":B" + CStr(j)).Select
ActiveSheet.Paste
Sheets("2 - 22").Select
i = i + 25
j = j + 1
Loop
End Sub

I need to copy the data in cells A1:B1 from 2-22 to A3:B3 on Template, then cells A26:B26 on 2-22 to A4:B4 on template and so on.

thank you much!
J.T.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Alright I did get it to work, wasn't specifying variable correctly and didnt type the sheet name in correctly.
 
Upvote 0

Forum statistics

Threads
1,223,630
Messages
6,173,456
Members
452,514
Latest member
cjkelly15

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