Download Workbook Example of Wait Message Macro
See Also: Speed up Excel VBA Code and Issues: Oct 2002 , Nov 2002 , Dec 2002 of our Newsletter
Back to: Excel VBA . Got any Excel/VBA Questions? Free Excel Help
Ever had one of those macros that seem to take forever to complete? Recorded macros in particular generally take much longer than well written VBA code. Most users in this day and age expect code to run and complete almost instantaneously once they click 'the button'. Unfortunately, Excel VBA code is generally slower than a lot of other code types.
If this is a problem with your code we can have Excel display a "Please Wait" message to the user. This way they know that code is running and Excel has not locked up on them! Unfortunately, one of the more popular ways to let the user know that code is running is via the use of a progress meter. There are 2 problems with this method;
The method that I prefer is to use VBA code that makes use of a Rectangle from the Drawing Toolbar
Sub DoIt() Application.ScreenUpdating = True With Sheet1.Shapes("Rectangle 1") .Visible = msoTrue = (Not Sheet1.Shapes("Rectangle 1").Visible) End With 'Toggling sheets Forces Rectangle 1to show while code is running Sheet2.Select Sheet1.Select
Run "Doit" Application.ScreenUpdating = False
The use of
Application.ScreenUpdating = False
See: Stop Screen Flicker and Speed up Macros
All you now need to do is run your macro as normal. You can of course use the macro in any Workbook simply by following the steps above.
Excel Dashboard Reports & Excel Dashboard Charts 50% Off Become an ExcelUser Affiliate & Earn Money
Special! Free Choice of Complete Excel Training Course OR Excel Add-ins Collection on all purchases totaling over $64.00. ALL purchases totaling over $150.00 gets you BOTH! Purchases MUST be made via this site. Send payment proof to [email protected] 31 days after purchase date.
Instant Download and Money Back Guarantee on Most Software
Excel Trader Package Technical Analysis in Excel With $139.00 of FREE software!
Microsoft � and Microsoft Excel � are registered trademarks of Microsoft Corporation. OzGrid is in no way associated with Microsoft
Some of our more popular products are below...
Convert Excel Spreadsheets To Webpages | Trading In Excel | Construction Estimators | Finance Templates & Add-ins Bundle | Code-VBA | Smart-VBA | Print-VBA | Excel Data Manipulation & Analysis | Convert MS Office Applications To...... | Analyzer Excel | Downloader Excel | MSSQL Migration Toolkit | Monte Carlo Add-in | Excel Costing Templates