Solved

Display Excel Form while VBA code runs

Posted on 2012-12-31
3
309 Views
Last Modified: 2012-12-31
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
0
Comment
Question by:ducky801
  • 2
3 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 38732936
Do this.

UserForm1.Show vbModeless
0
 
LVL 5

Author Closing Comment

by:ducky801
ID: 38733546
Works like a charm!  Thanks!
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 38733553
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2012
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Extract Names Based on Position in the Column 12 29
Excel - Data Validation 3 28
VBA Works in Excel 2010 Not 2016 Help! 5 18
How best to represent data in Excel? 13 26
This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question