Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Show Form whilst Macro is Running
Hi, I have some code which takes around 10 seconds to run when a
spreadsheet opens and I want to display a basic userform with the word "Calculating..." showing. I have managed to do this by adding the code under form_load, and calling the form when the spreadsheet opens - therefore the spreadsheet opens, the userform is displayed and the code runs. This is fine but ideally i would just like to be able to have the facility to run a macro and have a form display in the foreground in a straight-forward way. Can this be done? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Show Form whilst Macro is Running
Yeah, it is possible to do this. Basically, say you have a button to start
your macro. In the code for the click event of the button place the code to show you form: frmForm.load Now here is the trick, you want to call the first module of your main code from the Activate event of the userform, i.e.: Private Sub frmForm_Activate() Call [your sub here] 'and finally unload the form unload me 'unloads the user form End Sub Hope this makes sense "DAV135" wrote in message oups.com... Hi, I have some code which takes around 10 seconds to run when a spreadsheet opens and I want to display a basic userform with the word "Calculating..." showing. I have managed to do this by adding the code under form_load, and calling the form when the spreadsheet opens - therefore the spreadsheet opens, the userform is displayed and the code runs. This is fine but ideally i would just like to be able to have the facility to run a macro and have a form display in the foreground in a straight-forward way. Can this be done? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Stopping Code from Running whilst in Loop... | Excel Programming | |||
Status bar (or similar) to appear whilst running a long macro | Excel Discussion (Misc queries) | |||
How to display a form- to show status of the running program | Excel Discussion (Misc queries) | |||
How do I pause a Macro whilst it is running? | Excel Programming | |||
How to Mute/Enable Windows Sounds whilst running VBA code | Excel Programming |