ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   display userform for 10 seconds (https://www.excelbanter.com/excel-programming/417788-display-userform-10-seconds.html)

Sandy

display userform for 10 seconds
 
Hi
I am trying to have a UserForm display for 10 seconds and then have the rest
of my sub proceed.


have tried

********
frmPrime.Show
Application.Wait Now + TimeValue("00:00:10")
frmPrime.Hide
********

but this just stops the code permanently. Any ideas?
Sandy


papou[_4_]

display userform for 10 seconds
 
Hi Sandy
Just amend this line:
frmPrime.Show vbModeless

HTH
Cordially
Pascal

"Sandy" a écrit dans le message de news:
...
Hi
I am trying to have a UserForm display for 10 seconds and then have the
rest of my sub proceed.


have tried

********
frmPrime.Show
Application.Wait Now + TimeValue("00:00:10")
frmPrime.Hide
********

but this just stops the code permanently. Any ideas?
Sandy




Orion Cochrane

display userform for 10 seconds
 
Try this:
UserForm object:
Private Sub UserForm_Activate()
Application.OnTime Now + TimeValue("00:00:10"), "KillTheForm"
End Sub

Kill Module
Private Sub KillTheForm()
Unload UserForm1
End Sub

I use this for making welcome splashes in certain programs. The
UserForm_Activate occurs when the userform is triggered by an event. The
userform will display for 10 seconds (as per OP), and the KillTheForm
procedure kicks in, which unloads the userform.
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so we
know when we have answered your questions. Thanks.


"Sandy" wrote:

Hi
I am trying to have a UserForm display for 10 seconds and then have the rest
of my sub proceed.


have tried

********
frmPrime.Show
Application.Wait Now + TimeValue("00:00:10")
frmPrime.Hide
********

but this just stops the code permanently. Any ideas?
Sandy



Sandy

display userform for 10 seconds
 
Hi guys

Both work very well with the exception that the information on the userform
(labels) does not display - any ideas why this should happen?

Sandy

"Sandy" wrote in message
...
Hi
I am trying to have a UserForm display for 10 seconds and then have the
rest of my sub proceed.


have tried

********
frmPrime.Show
Application.Wait Now + TimeValue("00:00:10")
frmPrime.Hide
********

but this just stops the code permanently. Any ideas?
Sandy



Orion Cochrane

display userform for 10 seconds
 
What does this userform do?
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so we
know when we have answered your questions. Thanks.


"Sandy" wrote:

Hi guys

Both work very well with the exception that the information on the userform
(labels) does not display - any ideas why this should happen?

Sandy

"Sandy" wrote in message
...
Hi
I am trying to have a UserForm display for 10 seconds and then have the
rest of my sub proceed.


have tried

********
frmPrime.Show
Application.Wait Now + TimeValue("00:00:10")
frmPrime.Hide
********

but this just stops the code permanently. Any ideas?
Sandy




Sandy

display userform for 10 seconds
 
It is meant to simply display a message - "For further information refer to
bla bla" - for 10 seconds.
Sandy

"Orion Cochrane" wrote in message
...
What does this userform do?
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so
we
know when we have answered your questions. Thanks.


"Sandy" wrote:

Hi guys

Both work very well with the exception that the information on the
userform
(labels) does not display - any ideas why this should happen?

Sandy

"Sandy" wrote in message
...
Hi
I am trying to have a UserForm display for 10 seconds and then have the
rest of my sub proceed.


have tried

********
frmPrime.Show
Application.Wait Now + TimeValue("00:00:10")
frmPrime.Hide
********

but this just stops the code permanently. Any ideas?
Sandy




Orion Cochrane

display userform for 10 seconds
 
Make a label in the form big enough to display this message. Or you could
have a message box at the beginning of your code with the message. Once the
user clicks OK, the procedure will run. This may actually save time in that
the message box will not display for 10 seconds. Here's a sample of the
message box:
Sub Macro()
MsgBox "Your message here"
'Your code here
End Sub

The MsgBox will default to an OK button only if you copy my line to your
macro. I think the MsgBox route would be better, but I could be wrong.
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so we
know when we have answered your questions. Thanks.


"Sandy" wrote:

It is meant to simply display a message - "For further information refer to
bla bla" - for 10 seconds.
Sandy

"Orion Cochrane" wrote in message
...
What does this userform do?
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so
we
know when we have answered your questions. Thanks.


"Sandy" wrote:

Hi guys

Both work very well with the exception that the information on the
userform
(labels) does not display - any ideas why this should happen?

Sandy

"Sandy" wrote in message
...
Hi
I am trying to have a UserForm display for 10 seconds and then have the
rest of my sub proceed.


have tried

********
frmPrime.Show
Application.Wait Now + TimeValue("00:00:10")
frmPrime.Hide
********

but this just stops the code permanently. Any ideas?
Sandy




papou[_4_]

display userform for 10 seconds
 
Sandy
If the label already has text on it, and you want to change this text for
some time, then use the Repaint method:
Label1.Caption = ""For further information refer to bla bla"
UserForm1.Repaint
And use this method each time you change the label's text.

HTH
Cordially
Pascal

"Sandy" a écrit dans le message de news:
...
It is meant to simply display a message - "For further information refer
to bla bla" - for 10 seconds.
Sandy

"Orion Cochrane" wrote in
message ...
What does this userform do?
--
I am running on Excel 2003, unless otherwise stated. Please rate posts so
we
know when we have answered your questions. Thanks.


"Sandy" wrote:

Hi guys

Both work very well with the exception that the information on the
userform
(labels) does not display - any ideas why this should happen?

Sandy

"Sandy" wrote in message
...
Hi
I am trying to have a UserForm display for 10 seconds and then have
the
rest of my sub proceed.


have tried

********
frmPrime.Show
Application.Wait Now + TimeValue("00:00:10")
frmPrime.Hide
********

but this just stops the code permanently. Any ideas?
Sandy






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

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