Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find & Replace results to display specified chosen fields | Excel Discussion (Misc queries) | |||
Axis display as category | Charts and Charting in Excel | |||
Conditional display of a .jpeg file? | Excel Discussion (Misc queries) | |||
how to display heading of column corresponding to the cell | Excel Worksheet Functions | |||
Combine & Display “Fixed” & “Automatically Updated” Date Parts | Excel Worksheet Functions |