One of the ways that I transfer data is code like this:
(watch out for word wrap, each of these should be a
single line. The line continuation _ makes this so).
Note that there is no selection which makes the code faster.
Workbooks("MyBook").Sheets("MySheet").Range("A:B") . Copy _
Destination:= Workbooks("Booknext").Range("A1")
or
Workbooks("Booknext").Range("A:B")= _
Workbooks("MyBook").Sheets("MySheet").Range("A:B")
--
steveB
Remove "AYN" from email to respond
"Losse" wrote in message
...
I would like to fully automate copying the data from a few Excel files
and pasting the data from each onto separate sheets on one file. I
would like to do it from 1-30per. I have no idea how to do it, but this
is my attempt that is doomed to fail:
Do While Rng <= 30
For i = 1 To Rng
Windows(out13_T300K_Rngper2000).Activate
Columns("A:B").Select
Selection.Copy
Application.WindowState = xlMinimized
Windows(out13_iper2000).Activate
sheets.Add
ActiveSheet.Paste
ActiveSheet.Name = "300"
Windows(out13_T600K_Rngper2000).Activate
Columns("A:B").Select
Selection.Copy
Application.WindowState = xlMinimized
Windows(out13_iper2000).Activate
sheets.Add
ActiveSheet.Paste
ActiveSheet.Name = "600"
Windows(out13_T900K_Rngper2000).Activate
Columns("A:B").Select
Selection.Copy
Application.WindowState = xlMinimized
Windows(out13_iper2000).Activate
sheets.Add
ActiveSheet.Paste
ActiveSheet.Name = "900"
Call Grapher
Next i
Loop
--
Losse
------------------------------------------------------------------------
Losse's Profile:
http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=388024