Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
macros and screen updates
I've written a macro that updates several sheets and
graphs. Execution is very slow because of the constant refreshing of the display. Is there a way to turn off the screen updates until the macros have finished? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
macros and screen updates
Tim Laud wrote:
I've written a macro that updates several sheets and graphs. Execution is very slow because of the constant refreshing of the display. Is there a way to turn off the screen updates until the macros have finished? Application.ScreenUpdating = False Calculations can also slow down your macros. You might want to add Application.Calculation = xlCalculationManual to the start of your macro and Application.Calculation = xlCalculationAutomatic to the end. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
macros and screen updates
don't forget to reset to true at the end
-- Don Guillett SalesAid Software Granite Shoals, TX "Jerry Park" wrote in message . .. Tim Laud wrote: I've written a macro that updates several sheets and graphs. Execution is very slow because of the constant refreshing of the display. Is there a way to turn off the screen updates until the macros have finished? Application.ScreenUpdating = False Calculations can also slow down your macros. You might want to add Application.Calculation = xlCalculationManual to the start of your macro and Application.Calculation = xlCalculationAutomatic to the end. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
macros and screen updates
-----Original Message----- I've written a macro that updates several sheets and graphs. Execution is very slow because of the constant refreshing of the display. Is there a way to turn off the screen updates until the macros have finished? . At the beginning of your macro add in Application.ScreenUpdating = False Make sure that at the end of your macro that you set Application.ScreenUpdating = True HTH David |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
macros and screen updates
Tim
Early on in code use these lines Application.ScreenUpdating = False Application.Calculation = xlCalculationManual At end of code these Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True Gord Dibben Excel MVP - XL97 SR2 & XL2002 On Fri, 1 Aug 2003 08:42:12 -0700, "Tim Laud" wrote: I've written a macro that updates several sheets and graphs. Execution is very slow because of the constant refreshing of the display. Is there a way to turn off the screen updates until the macros have finished? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
macros and screen updates
Hello Tim,
There certainly is a way to control screen updating within a VBA macro. The following is from the VBA help file, with a query on "ScreenUpdating." ScreenUpdating Property See Also Applies To Example Specifics True if screen updating is turned on. Read/write Boolean. Remarks Turn screen updating off to speed up your macro code. You won't be able to see what the macro is doing, but it will run faster. Remember to set the ScreenUpdating property back to True when your macro ends. Example This example demonstrates how turning off screen updating can make your code run faster. The example hides every other column on Sheet1, while keeping track of the time it takes to do so. The first time the example hides the columns, screen updating is turned on; the second time, screen updating is turned off. When you run this example, you can compare the respective running times, which are displayed in the message box. Dim elapsedTime(2) Application.ScreenUpdating = True For i = 1 To 2 If i = 2 Then Application.ScreenUpdating = False startTime = Time Worksheets("Sheet1").Activate For Each c In ActiveSheet.Columns If c.Column Mod 2 = 0 Then c.Hidden = True End If Next c stopTime = Time elapsedTime(i) = (stopTime - startTime) * 24 * 60 * 60 Next i Application.ScreenUpdating = True MsgBox "Elapsed time, screen updating on: " & elapsedTime(1) & _ " sec." & Chr(13) & _ "Elapsed time, screen updating off: " & elapsedTime(2) & _ " sec." -------------------- From: "Tim Laud" Subject: macros and screen updates Date: Fri, 1 Aug 2003 08:42:12 -0700 I've written a macro that updates several sheets and graphs. Execution is very slow because of the constant refreshing of the display. Is there a way to turn off the screen updates until the macros have finished? Regards, Chris Jensen[MSFT] This posting is provided “AS IS” with no warranties, and confers no rights. “Microsoft Security Announcement: Have you installed the patch for Microsoft Security Bulletin MS03-026?* If not Microsoft strongly advises you to review the information at the following link regarding Microsoft Security Bulletin MS03-026 http://www.microsoft.com/security/se...s/ms03-026.asp and/or to visit Windows Update at http://windowsupdate.microsoft.com to install the patch. Running the SCAN program from the Windows Update site will help to insure you are current with all security patches, not just MS03-026.” |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
screen tip with macros | Excel Discussion (Misc queries) | |||
Screen flash while running macros | Excel Discussion (Misc queries) | |||
CAE macro for green screen updates with Excel data | Excel Discussion (Misc queries) | |||
print box opens in right screen of dual screen setup why | Excel Discussion (Misc queries) | |||
Need to convert point on screen to various screen resolutions | Excel Discussion (Misc queries) |