Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
HAL
 
Posts: n/a
Default Display a countdown timer

Is it possible for A1 to display a time countdown in mm:ss
by adding to this:

Sub Auto_Open()
Application.OnTime Now + TimeValue("00:05:00"), "Closeit"
End Sub

Sub Closeit()
With ActiveWorkbook
.Save
.Close
End With
End Sub

TIA
  #2   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

HAL,

Format A1 for mm:ss, then use:

Dim myTime As Date

Sub Auto_Open()
Application.OnTime Now + TimeValue("00:05:00"), "Closeit"
myTime = Now + TimeValue("00:05:00")
Application.OnTime Now + TimeValue("00:00:01"), "TimeA1"
End Sub

Sub Closeit()
With ActiveWorkbook
.Save
.Close
End With
End Sub

Sub TimeA1()
Range("A1").Value = myTime - Now
Application.OnTime Now + TimeValue("00:00:01"), "TimeA1"
End Sub

HTH,
Bernie
MS Excel MVP

"HAL" wrote in message
...
Is it possible for A1 to display a time countdown in mm:ss
by adding to this:

Sub Auto_Open()
Application.OnTime Now + TimeValue("00:05:00"), "Closeit"
End Sub

Sub Closeit()
With ActiveWorkbook
.Save
.Close
End With
End Sub

TIA



  #3   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

HAL,

Actually, use this, or else the file may be reopened:

Dim myTime1 As Date
Dim myTime2 As Date

Sub Auto_Open()
myTime1 = Now + TimeValue("00:05:00")
Application.OnTime myTime1, "Closeit"
myTime2 = Now + TimeValue("00:00:01")
Application.OnTime myTime2, "TimeA1"
End Sub

Sub Closeit()
Application.OnTime myTime2, "TimeA1", , False
With ActiveWorkbook
.Save
.Close
End With
End Sub

Sub TimeA1()
Range("A1").Value = myTime1 - Now
myTime2 = Now + TimeValue("00:00:01")
Application.OnTime myTime2, "TimeA1"
End Sub


HTH,
Bernie
MS Excel MVP


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
HAL,

Format A1 for mm:ss, then use:

Dim myTime As Date

Sub Auto_Open()
Application.OnTime Now + TimeValue("00:05:00"), "Closeit"
myTime = Now + TimeValue("00:05:00")
Application.OnTime Now + TimeValue("00:00:01"), "TimeA1"
End Sub

Sub Closeit()
With ActiveWorkbook
.Save
.Close
End With
End Sub

Sub TimeA1()
Range("A1").Value = myTime - Now
Application.OnTime Now + TimeValue("00:00:01"), "TimeA1"
End Sub

HTH,
Bernie
MS Excel MVP

"HAL" wrote in message
...
Is it possible for A1 to display a time countdown in mm:ss
by adding to this:

Sub Auto_Open()
Application.OnTime Now + TimeValue("00:05:00"), "Closeit"
End Sub

Sub Closeit()
With ActiveWorkbook
.Save
.Close
End With
End Sub

TIA





  #4   Report Post  
HAL
 
Posts: n/a
Default

Thank you very much! Much appreciated!

-----Original Message-----
HAL,

Actually, use this, or else the file may be reopened:

Dim myTime1 As Date
Dim myTime2 As Date

Sub Auto_Open()
myTime1 = Now + TimeValue("00:05:00")
Application.OnTime myTime1, "Closeit"
myTime2 = Now + TimeValue("00:00:01")
Application.OnTime myTime2, "TimeA1"
End Sub

Sub Closeit()
Application.OnTime myTime2, "TimeA1", , False
With ActiveWorkbook
.Save
.Close
End With
End Sub

Sub TimeA1()
Range("A1").Value = myTime1 - Now
myTime2 = Now + TimeValue("00:00:01")
Application.OnTime myTime2, "TimeA1"
End Sub


HTH,
Bernie
MS Excel MVP


"Bernie Deitrick" <deitbe @ consumer dot org wrote in

message
...
HAL,

Format A1 for mm:ss, then use:

Dim myTime As Date

Sub Auto_Open()
Application.OnTime Now + TimeValue

("00:05:00"), "Closeit"
myTime = Now + TimeValue("00:05:00")
Application.OnTime Now + TimeValue("00:00:01"), "TimeA1"
End Sub

Sub Closeit()
With ActiveWorkbook
.Save
.Close
End With
End Sub

Sub TimeA1()
Range("A1").Value = myTime - Now
Application.OnTime Now + TimeValue("00:00:01"), "TimeA1"
End Sub

HTH,
Bernie
MS Excel MVP

"HAL" wrote in

message
...
Is it possible for A1 to display a time countdown in

mm:ss
by adding to this:

Sub Auto_Open()
Application.OnTime Now + TimeValue

("00:05:00"), "Closeit"
End Sub

Sub Closeit()
With ActiveWorkbook
.Save
.Close
End With
End Sub

TIA





.

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
Find & Replace results to display specified chosen fields samuel Excel Discussion (Misc queries) 1 December 28th 04 08:43 AM
Axis display as category doco Charts and Charting in Excel 4 December 12th 04 04:45 PM
Conditional display of a .jpeg file? sbhogle Excel Discussion (Misc queries) 2 November 30th 04 05:57 AM
how to display heading of column corresponding to the cell angelrain Excel Worksheet Functions 2 November 2nd 04 04:57 PM
Combine & Display “Fixed” & “Automatically Updated” Date Parts texcel Excel Worksheet Functions 1 November 1st 04 05:38 PM


All times are GMT +1. The time now is 12:32 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"