Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to make a timer in Excel 97

Hi!

Hope someone can help me.

I would like to have a form displaying a negative timer, say from 30 t
1 second. Something very simple if possible.

I have a button for printing a form and a msgbox asking if everythin
was fine and I would like to put a visible delay between them.

I made a delay inside a macro that work but it is not visible.

Can you help?

Alai

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default How to make a timer in Excel 97

Alain, the following would work if you had a label on a userform named
Label1 :

Sub WaitAwhile()
dim I as integer
for I = 1 to 30
Userform1.Label1.caption = I
Application.Wait Now() + TimeSerial(0, 0, 1)
next
end sub

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"alainB " wrote in message
...
Hi!

Hope someone can help me.

I would like to have a form displaying a negative timer, say from 30 to
1 second. Something very simple if possible.

I have a button for printing a form and a msgbox asking if everything
was fine and I would like to put a visible delay between them.

I made a delay inside a macro that work but it is not visible.

Can you help?

Alain


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default How to make a timer in Excel 97

If you just want a delay try the WAIT METHOD as in:
Application.Wait Now + #00:00:30#

If you want some timer to run in the background, lookup OnTime in VBA Help.

TH

On 4/15/04 16:56, in article , "alainB "
wrote:

Hi!

Hope someone can help me.

I would like to have a form displaying a negative timer, say from 30 to
1 second. Something very simple if possible.

I have a button for printing a form and a msgbox asking if everything
was fine and I would like to put a visible delay between them.

I made a delay inside a macro that work but it is not visible.

Can you help?

Alain

---
Message posted from
http://www.ExcelForum.com/


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to make a timer in Excel 97

Thanks Bob

The macro is working for the delay but the form is not visible.

I suppose I would have to put a line or two more to make it pop up o
the spreadsheet.

Can you help again.

Thanks

Alai

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to make a timer in Excel 97

I put this line:

UserForm1.show

Now, the form is popping up nicely but the timer is not working. Afte
clicking on the cancel (X) the form is diseapering and the timer start


Would be exactly what I need if it was working.

To be more clear if I can, I need a form that is popping up and sho
the number of seconds remaining from a certain delay, say 30 seconds
then 29 then 28 before disapearing when it reach 0.

This way, it would show that something is happening during the neede
delay.

Thanks

Alai

--
Message posted from http://www.ExcelForum.com



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to make a timer in Excel 97

Finally, it is working!


Here is my macro:

Sub WaitAwhile()
UserForm1.Show
End Sub


Here is the code I inserted in the UserForm:

Private Sub UserForm_Layout()
Dim I As Integer
For I = 30 To 0 Step -1
UserForm1.Label1.Caption = I
Application.Wait Now() + TimeSerial(0, 0, 1)
Next
Unload Me
End Sub

I found out that the "Sub UserForm_Layout()"
would not require any input (click or key or else)
to "play itself".

I don't know if this is elegant but it
is working great. The only thing is that if
I click on the form while it is active the display
will freese and will not show the time decrease
any more until the end of the delay and the
unload.

How to fix that?


Alai

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Timer in Excel Gil Excel Discussion (Misc queries) 2 January 14th 10 12:57 PM
Pop up timer for excel jlclyde Excel Discussion (Misc queries) 1 August 31st 07 10:08 PM
how do I make a countdown timer in excel? Ken C New Users to Excel 1 October 28th 06 04:38 PM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM
Excel functions?????????FIRST TIMER JC[_5_] Excel Programming 0 September 11th 03 07:52 PM


All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"