ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro slow when copy and pasting (https://www.excelbanter.com/excel-programming/440920-macro-slow-when-copy-pasting.html)

wsleepywil

Macro slow when copy and pasting
 
Running Excel 2003

I am copying multiple data ranges from one workbook to another and the macro
just seems to be very slow during the copy phase of each data range. There
are eight ranges of similar size to be copied. The paste phase seems fast.

Here is a sample of the copy and paste code.

Windows("20100204-Data Input-u.xls").Activate
ActiveSheet.Select
Range("b6:g36").Select
Application.CutCopyMode = False
Selection.Copy
Windows("20090401-MST In Use-U.xls").Activate
Sheets("Data").Select
Range("b6:g36").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False



Don Guillett[_2_]

Macro slow when copy and pasting
 
try this idea. with both open. Be sure of line continuations _ in the right
place. And the first DATA may need to be changed to the name of your source
sheet.

workbooks("20090401-MST In Use-U.xls"). _
Sheets("Data").Range("b6:g36").value= _
workbooks("20090204-Data Input-u.xls"). _
Sheets("Data").Range("b6:g36").value
'=========

Don Guillett
Microsoft MVP Excel
SalesAid Software

"wsleepywil" wrote in message
...
Running Excel 2003

I am copying multiple data ranges from one workbook to another and the
macro
just seems to be very slow during the copy phase of each data range. There
are eight ranges of similar size to be copied. The paste phase seems fast.

Here is a sample of the copy and paste code.

Windows("20100204-Data Input-u.xls").Activate
ActiveSheet.Select
Range("b6:g36").Select
Application.CutCopyMode = False
Selection.Copy
Windows("20090401-MST In Use-U.xls").Activate
Sheets("Data").Select
Range("b6:g36").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False





All times are GMT +1. The time now is 05:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com