Automatically close Userform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an userform that I would like to show and be visible for 5 seconds
when opening an Excel file.

I would just like to show the userform for a certain length of time and
would like it to close without any interaction from the user.

Would appreciate all help. Many thanks in advance.
 
In the workbook_open event activate the userform with something like

userform1.show

then in the userform_activate event paste this code.

Private Sub UserForm_Activate()
PauseTime = 5 ' Set duration in seconds
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
Loop
Finish = Timer
UserForm1.Hide
End Sub

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top