Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default 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
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
Wait number of seconds in A1 CLR Excel Programming 5 July 7th 09 04:55 PM
Convert time in number of seconds Heera Excel Worksheet Functions 2 August 22nd 08 01:29 PM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM
convert a number of seconds to HH:MM:SS? Steff_DK[_21_] Excel Programming 2 June 18th 04 10:42 PM
Count Down Timer (Seconds) boblauder Excel Programming 1 January 21st 04 02:55 PM


All times are GMT +1. The time now is 08:28 AM.

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

About Us

"It's about Microsoft Excel"