Hi, I'm trying to import data from one worksheet (Results.xls) onto another one (Original Template.xls) so I can manipulate it. The problem is that the data from results.xls varies from day to day so I've written a dynamic macro to copy and paste it.

This macro is saved under Original Template.xls

Sub Getting_Data()
Dim j As Long


Workbooks.Open Filename:="D:\Summer Project\Results.xls"

j = 1
Do While Cells(j, 1) <> Empty
Cells(j, 1).Select
Selection.Copy
Windows("Original Template.xls").Activate
Cells(j + 1, 1).Select
ActiveSheet.Paste

j = j + 1
Windows("Results.xls").Activate

Loop

End sub

The problem is that this takes a while to do because the computer'll go through one cell at a time to copy and paste.



I tried to shorthand it by doing this, :

Range("A1:AJ").Select
Selection.Copy

but excel doesn't recognize the J in AJ as a variable and the macro won't compile properly. What is the proper syntax to have a variable in the Range function?


Thanks Thanks