MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Userform.show time frame?


Posted by Paul Magruder on February 26, 2001 8:41 AM


Is there code that will allow a form to be shown for a specified time frame? (10 sec)?

userform1.show
userform1.hide

Can I specify the amount of time in between?
Thanks in advance.
Paul Magruder


Posted by Dax on February 26, 2001 12:44 PM


Paul,

This should do what you're after:-


Private Sub UserForm_Activate()
t = Timer
Do
DoEvents
Loop Until Timer = t + 10
Me.Hide
End Sub

Posted by David Hawley on February 27, 2001 3:32 AM


Hi Paul

I'm guessing you are wanting to create a splash screen on opening of your Workbook. If so:

1. Right click on the sheet picture , top left next to "File" and select "View Code". Paste in this:

Private Sub Workbook_Open()
Run "ShowForm"
End Sub


Then in a normal module place these:

Sub CloseForm()
Unload UserForm1
End Sub

Sub CloseForm()
Application.OnTime Now + TimeValue("00:00:10"), "CloseForm"
UserForm1.Show
End Sub


Dave

OzGrid Business Applications

Posted by Paul Magruder on February 27, 2001 5:00 AM

Re: Thanks

Posted by Paul Magruder on February 27, 2001 5:01 AM

Re: Thanks