Automatically close a userform

  • Thread starter Thread starter ForSale
  • Start date Start date
F

ForSale

The following isn't working. what am i doing wrong?

UserForm2.Show
Application.Wait (Now() + TimeValue("0:00:04"))
Unload UserForm2

I'm trying to pop up a userform for 4 seconds, then close it.
I initally added some basic shapes - a rectangle and three arrows - an
did the same thing. it worked the first time, but then they wouldn'
pop up anymore, but that's not important.
thanks
 
The Wait will not execute until the form unloads when it is inline. Put that
code in the Userform Activate event of the userform

Private UserForm_Activate()
Application.Wait (Now() + TimeValue("0:00:04"))
Unload UserForm2
End Sub
 

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