ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User form/ to show please wait (https://www.excelbanter.com/excel-programming/322543-user-form-show-please-wait.html)

Momo

User form/ to show please wait
 
Any help please?

I want to add into a macro a userform or something so that when the macro is
started a little notice appears saying "Please Wait" or something and stays
on for the duration of the macro and then closes automatically at the end of
the macro? when i try putting in a show aznd then a hide it opens and waits
for a response, any help please,

Many thanks,

Andy

Tom Ogilvy

User form/ to show please wait
 
Make it non modal

Userform1.show vbModeless
--
Regards,
Tom Ogilvy

"Momo" wrote in message
...
Any help please?

I want to add into a macro a userform or something so that when the macro

is
started a little notice appears saying "Please Wait" or something and

stays
on for the duration of the macro and then closes automatically at the end

of
the macro? when i try putting in a show aznd then a hide it opens and

waits
for a response, any help please,

Many thanks,

Andy




Mike Fogleman

User form/ to show please wait
 
A simpler method, but effective is to show an empty area of the sheet with a
message in a cell while the macro runs.

Sub Wait()
ActiveSheet.Range("DN10").Value = "Please Wait..."
Range("DN9").Activate
Application.ScreenUpdating = False
'Your routine Here
Range("DN10").Clear
Application.ScreenUpdating = True
Range("A1").Select
End Sub

Mike F

"Momo" wrote in message
...
Any help please?

I want to add into a macro a userform or something so that when the macro
is
started a little notice appears saying "Please Wait" or something and
stays
on for the duration of the macro and then closes automatically at the end
of
the macro? when i try putting in a show aznd then a hide it opens and
waits
for a response, any help please,

Many thanks,

Andy




Momo

User form/ to show please wait
 
Thanks tom, this seems to work, just one thing, how do i get the userform to
then close once the macro has finished?

Thanks

andy



Momo

User form/ to show please wait
 
Tom, I have now got it to close at the end of the macro, just wondering if
there is any way of removing the close option when the window pops up, the
little x in the corner,

thanks

Andy



Tom Ogilvy

User form/ to show please wait
 
Unload Userform1 at the end of your code

--
Regards,
Tom Ogilvy

"Momo" wrote in message
...
Thanks tom, this seems to work, just one thing, how do i get the userform

to
then close once the macro has finished?

Thanks

andy





Tom Ogilvy

User form/ to show please wait
 
Use the queryclose event to cancel the attempt.

http://support.microsoft.com/default...b;en-us;213713
XL2000: Preventing UserForm from Being Dismissed with Close Button

works with all versions of excel that support userforms.

--
Regards,
Tom Ogilvy



"Momo" wrote in message
...
Tom, I have now got it to close at the end of the macro, just wondering if
there is any way of removing the close option when the window pops up, the
little x in the corner,

thanks

Andy





Momo

User form/ to show please wait
 
I put userform1.hide at the end, is that the way to do it? it got rid of it

Tom Ogilvy

User form/ to show please wait
 
I would suggest unloading it:

Unload Userform1 at the end of your code

--
Regards,
Tom Ogilvy

--
Regards,
Tom Ogilvy

"Momo" wrote in message
...
I put userform1.hide at the end, is that the way to do it? it got rid of

it



Momo

User form/ to show please wait
 
Tom,

one last thing,

when i now run my macro the user form appears, but the label which i have
written the text appears as a white empty box, is this because of the
vbmodeless?
if so am i better just to write what i want as the title of the form?

thanks,

Andy

Tom Ogilvy

User form/ to show please wait
 
Userform1.show vbModeless
doevents

.. . .

Unload Userform1

--
Regards,
Tom Ogilvy



"Momo" <
wrote in message
...
Tom,

one last thing,

when i now run my macro the user form appears, but the label which i have
written the text appears as a white empty box, is this because of the
vbmodeless?
if so am i better just to write what i want as the title of the form?

thanks,

Andy





All times are GMT +1. The time now is 12:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com