Still stuck

  • Thread starter Thread starter Mark \(InWales\)
  • Start date Start date
M

Mark \(InWales\)

Hello world

Still can't find the solution to this problem. I have a userform that shows
for 10 seconds as a splash screen on the workbook_open event. What I would
like to do is have a countdown timer from 10 to 1 to show the user that
something is happening. I can get the textbox to show the intial value but
I am having real problems in getting it to count down so the user can see
the changes! 10 to 1 in under a second! I have looked at the ontime
method, wait, pause method etc but don't seem to be able to get the correct
syntax...

Office 97 and XP home

Mark (InWales)
 
Mark,
Try this. Put a label on your userform and the following code in the form
activate event.

Private Sub UserForm_Activate()
Dim i
Dim newhour
Dim newminute
Dim newsecond
Dim waittime
For i = 10 To 0 Step -1
newhour = Hour(Now())
newminute = Minute(Now())
newsecond = Second(Now()) + 1
waittime = TimeSerial(newhour, newminute, newsecond)
Application.Wait waittime
DoEvents
Me.Label1 = i
Next
Unload UserForm1
End Sub

Neil
 
S T U N N I N G

Thank you very much Neil for your help - excellent!
Mark (InWales)
 

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