ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   copying macro (https://www.excelbanter.com/excel-programming/284517-copying-macro.html)

MarkS[_2_]

copying macro
 
Hi,
I use this macro and every time it runs the Spreadsheet
gets bigger and slower. By the end of the month it has
grown from 127 Kb to 1,238 Kb and is very slow to open or
update. The first part of the macro copy yesterday data
further down the spreadsheet, so I can see where it has
changed and by how much. The second part opens another
spreadsheet copys the data and then closes the spreadsheet.

I need to find what the extra part is and how I stop
copying it across.


' Yesterdays

Windows("Contracts_Capacity.xls").Activate
Sheets("Shaped_Generation").Select
Range("C4:BK8").Select
Application.CutCopyMode = False
Selection.Copy
Range("C11").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

' Add New Planned Generation

Workbooks.Open FileName:= _
"\\rimmer\trader\MarkS\Update
Position\Planned_Generation.xls"
Range("A1:BK6").Select
Selection.Copy
Windows("Contracts_Capacity.xls").Activate
Sheets("Shaped_Generation").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False


MarkS


Tom Ogilvy

copying macro
 
Don't see anything in your code that would cause that kind of growth.

--
Regards,
Tom Ogilvy

MarkS wrote in message
...
Hi,
I use this macro and every time it runs the Spreadsheet
gets bigger and slower. By the end of the month it has
grown from 127 Kb to 1,238 Kb and is very slow to open or
update. The first part of the macro copy yesterday data
further down the spreadsheet, so I can see where it has
changed and by how much. The second part opens another
spreadsheet copys the data and then closes the spreadsheet.

I need to find what the extra part is and how I stop
copying it across.


' Yesterdays

Windows("Contracts_Capacity.xls").Activate
Sheets("Shaped_Generation").Select
Range("C4:BK8").Select
Application.CutCopyMode = False
Selection.Copy
Range("C11").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

' Add New Planned Generation

Workbooks.Open FileName:= _
"\\rimmer\trader\MarkS\Update
Position\Planned_Generation.xls"
Range("A1:BK6").Select
Selection.Copy
Windows("Contracts_Capacity.xls").Activate
Sheets("Shaped_Generation").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False


MarkS




marks

copying macro
 
how then do I find what is causing the spreadsheet to grow

MarkS
-----Original Message-----
Don't see anything in your code that would cause that

kind of growth.

--
Regards,
Tom Ogilvy

MarkS wrote in message
...
Hi,
I use this macro and every time it runs the Spreadsheet
gets bigger and slower. By the end of the month it has
grown from 127 Kb to 1,238 Kb and is very slow to open

or
update. The first part of the macro copy yesterday data
further down the spreadsheet, so I can see where it has
changed and by how much. The second part opens another
spreadsheet copys the data and then closes the

spreadsheet.

I need to find what the extra part is and how I stop
copying it across.


' Yesterdays

Windows("Contracts_Capacity.xls").Activate
Sheets("Shaped_Generation").Select
Range("C4:BK8").Select
Application.CutCopyMode = False
Selection.Copy
Range("C11").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

' Add New Planned Generation

Workbooks.Open FileName:= _
"\\rimmer\trader\MarkS\Update
Position\Planned_Generation.xls"
Range("A1:BK6").Select
Selection.Copy
Windows("Contracts_Capacity.xls").Activate
Sheets("Shaped_Generation").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlValues,
Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False


MarkS



.



All times are GMT +1. The time now is 03:35 AM.

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