Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop screen updating in Excel 2

Status
Not open for further replies.

DanAuber

IS-IT--Management
Apr 28, 2000
255
FR
Can anyone tell me the VB to stop my Excel Macro from updating the screen while it runs. In other words - when I click run - I just want a message saying "Macro Running" or something - then the code will run and finish and the finished position will be displayed with a message like "Macro Finished". I don't want users to see the screen 'flicking' around as the code moves between cells and worksheets

Any help gratefully recieved

Dan [sig]<p>Dan Auber<br><a href=mailto:DanAuber@aol.com>DanAuber@aol.com</a><br><a href= Auber's Home Page</a><br> [/sig]
 
Dan,

The code to stop the screen updating is
Application.ScreenUpdating = False

Try it in combination with these lines:
Application.ScreenUpdating = False
Application.StatusBar = &quot;Running macro.&quot;
--your code here..
MsgBox &quot;Macro complete&quot;, vbOKOnly + vbInformation, &quot;Title&quot;
Application.ScreenUpdating = True
[sig][/sig]
 
Just some additional info:

If you want to do this in VBA for Access, the command is:
DoCmd.Echo False ' Also, a second Optional Parameter is to add a string that _
goes into the Status Bar while screen update is off.

The command to turn screen updating back on is:
DoCmd.Echo True

*** WARNING ***
If you use this, MAKE SURE you include error checking, and if you recieve ANY error,
turn your screen updating back on. Access97 (and probably 2000, don't know yet)
will NOT turn your screen updating back on, until you explicitly tell it to. If this happens, and you have an error. You'll get a frozen application, and have to kill it useing the task manager.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top