Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
number of seconds timer
hi,
I want to be able to count from 1 to 120 seconds in a cell when i start the macro, and then stop when i get to 120 - what is the best way of doing this. Hope you can help. Thaanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
number of seconds timer
This pauses the macro for 120 seconds while other events are allowed to
occur. t = Timer + 120 Do While Timer < t DoEvents Loop "sdg8481" wrote in message ... hi, I want to be able to count from 1 to 120 seconds in a cell when i start the macro, and then stop when i get to 120 - what is the best way of doing this. Hope you can help. Thaanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
number of seconds timer
Hi,
Thank you for this, but unfortunatley its not quite what i was after.....sorry my original post was a little rushed. Basically, i need a number in cell A1 to count to 120 (1 per second) and then stop once it hits 120. Hope this makes a little more sense. Thank You "JLGWhiz" wrote: This pauses the macro for 120 seconds while other events are allowed to occur. t = Timer + 120 Do While Timer < t DoEvents Loop "sdg8481" wrote in message ... hi, I want to be able to count from 1 to 120 seconds in a cell when i start the macro, and then stop when i get to 120 - what is the best way of doing this. Hope you can help. Thaanks . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
number of seconds timer
Hi
Would this do ? Sub count() Dim i As Integer Dim x As Integer x = 120 Range("A1").Value = 0 For i = 1 To x mycount = Range("a1") + 1 Application.Wait (Now + TimeValue("0:00:01")) Range("a1") = mycount Next i End Sub ------------------ This will count 2 minutes in cell A1, just change A1 to your choice. HTH John "sdg8481" wrote in message ... hi, I want to be able to count from 1 to 120 seconds in a cell when i start the macro, and then stop when i get to 120 - what is the best way of doing this. Hope you can help. Thaanks |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
number of seconds timer
Works perfectly, brilliant Thank You
"John" wrote: Hi Would this do ? Sub count() Dim i As Integer Dim x As Integer x = 120 Range("A1").Value = 0 For i = 1 To x mycount = Range("a1") + 1 Application.Wait (Now + TimeValue("0:00:01")) Range("a1") = mycount Next i End Sub ------------------ This will count 2 minutes in cell A1, just change A1 to your choice. HTH John "sdg8481" wrote in message ... hi, I want to be able to count from 1 to 120 seconds in a cell when i start the macro, and then stop when i get to 120 - what is the best way of doing this. Hope you can help. Thaanks . |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
number of seconds timer
You're welcome
Thanks for feeding back. Regards John "sdg8481" wrote in message ... Works perfectly, brilliant Thank You "John" wrote: Hi Would this do ? Sub count() Dim i As Integer Dim x As Integer x = 120 Range("A1").Value = 0 For i = 1 To x mycount = Range("a1") + 1 Application.Wait (Now + TimeValue("0:00:01")) Range("a1") = mycount Next i End Sub ------------------ This will count 2 minutes in cell A1, just change A1 to your choice. HTH John "sdg8481" wrote in message ... hi, I want to be able to count from 1 to 120 seconds in a cell when i start the macro, and then stop when i get to 120 - what is the best way of doing this. Hope you can help. Thaanks . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Wait number of seconds in A1 | Excel Programming | |||
Convert time in number of seconds | Excel Worksheet Functions | |||
Stopping a Timer / Running a timer simultaneously on Excel | Excel Discussion (Misc queries) | |||
convert a number of seconds to HH:MM:SS? | Excel Programming | |||
Count Down Timer (Seconds) | Excel Programming |