pause a macro to display a form for x seconds then end

M

MyKool

Hi, I have a macro which basically you click on and it brings uo a form
(Userform2) which you input a password and it unprotects a sheet. what I wish
to do it once the button is clicked display a additional userform (Userform1)
for say 3 seconds saying well done then hide the userform and carry on as
normal.
I have tried the following but does not work :
(put in the userform2 button code)

Private Sub CommandButton1_Click()
UserForm2.Hide
UserForm1.Show
timeDelay = 1
UserForm1.Hide
End Sub

Please help me

Regards
 
T

Tushar Mehta

Check out XL VBA help for the Application object's Wait method.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Multi-disciplinary business expertise
+ Technology skills
= Optimal solution to your business problem
Recipient Microsoft MVP award 2000-2005
 
T

tp

I use this:
Create a form i.e frmKvitto
(In the macro:)

Application.OnTime Now + TimeValue("00:00:03"), "CloseForm"
(Sheets("Meny").Select)
frmKvitto.Show


Public Sub CloseForm()
On Error Resume Next
frmKvitto.Hide
End Sub


"MyKool" skrev:
 

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

Top