Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stopping Code from Running whilst in Loop... Chris Gorham Excel Programming 2 November 21st 05 07:27 AM
Status bar (or similar) to appear whilst running a long macro Ant Excel Discussion (Misc queries) 8 November 11th 05 09:21 AM
How to display a form- to show status of the running program Joseph Excel Discussion (Misc queries) 2 May 31st 05 11:31 AM
How do I pause a Macro whilst it is running? Gary[_20_] Excel Programming 4 August 26th 04 01:08 AM
How to Mute/Enable Windows Sounds whilst running VBA code Hotbird[_3_] Excel Programming 0 July 29th 04 04:43 PM


All times are GMT +1. The time now is 08:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"