Display Excel Form while VBA code runs

ducky801
ducky801 used Ask the Experts™
on
I have an excel workbook with a lot of custom code going on in it and it takes a while to calculate (5-7 seconds)

Because of this, instead of leaving calculation set to Automatic, I manage it with VBA as the user clicks around and does different things (toggling calculation on and off, and recalculating programmatically as necessary).  All of this works fine.

As a nice-to-have, I'd like to display a form with a label on it that says "Calculating.  Please wait" while the calc occurs so the user doesn't just think their computer is broken.  Problem is, when I display such a form via code, the rest of the code doesn't complete until I close the form manually again (clicking on the X button).  Is there a way around this?

In other words:  is there a way to make the form run asynchronously from the code that displayed it?

AR
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Older than dirt
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
Do this.

UserForm1.Show vbModeless

Author

Commented:
Works like a charm!  Thanks!
Martin LissOlder than dirt
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2012

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial