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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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