ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Speed of Macro on 2 PC (https://www.excelbanter.com/excel-programming/443332-speed-macro-2-pc.html)

misskh

Speed of Macro on 2 PC
 
Hi,

Can someone please help. We have 2 PCs.

When a macro is run on PC 1, no issue, and I run this almost everyday.

Then I open up the same file and run the same macro on PC 2, the macro
is really really slow.

When I go back to PC 1 and try to run the same file I have the same
issue as PC 2.

What I usually do to resolve the issue is recreate the file from
scratch, put in the macro.
If I run this on PC1, again I have no issue. And I can run it as may
times as I want with no issue.

Again, if I open up the file and run it on PC2, same problem.

Dave Peterson[_2_]

Speed of Macro on 2 PC
 
If your code is hiding/showing/deleting/inserting rows or columns, then maybe...

(Saved from a previous post)

Do you see the dotted lines that you get after you do a print or print preview?

If you do
Tools|Options|view tab|uncheck display page breaks

does the run time go back to normal?

You may want to do something like:

Option Explicit
Sub testme()

Dim CalcMode As Long
Dim ViewMode As Long

Application.ScreenUpdating = False

CalcMode = Application.Calculation
Application.Calculation = xlCalculationManual

ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView

ActiveSheet.DisplayPageBreaks = False

'do the work (Your code goes here)

'put things back to what they were
Application.Calculation = CalcMode
ActiveWindow.View = ViewMode

End Sub

Being in View|PageBreak Preview mode can slow macros down, too.

On 07/12/2010 19:20, misskh wrote:
Hi,

Can someone please help. We have 2 PCs.

When a macro is run on PC 1, no issue, and I run this almost everyday.

Then I open up the same file and run the same macro on PC 2, the macro
is really really slow.

When I go back to PC 1 and try to run the same file I have the same
issue as PC 2.

What I usually do to resolve the issue is recreate the file from
scratch, put in the macro.
If I run this on PC1, again I have no issue. And I can run it as may
times as I want with no issue.

Again, if I open up the file and run it on PC2, same problem.


--
Dave Peterson


All times are GMT +1. The time now is 10:17 AM.

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