#1   Report Post  
Posted to microsoft.public.excel.programming
ew ew is offline
external usenet poster
 
Posts: 27
Default Count down

All-
Is there a way to show in a cell in a rolling countdown. For example I
would like the timer to start at 30 mins (30:00) and countdown to 0. I would
like to take a current cell that contains a =now() formula and replace it
with this, but the catch would be it needs to intigrate with the on-time
method so that between the on-time method running the procedure it would
count down from 30-0 min. Is there anything out there like this?

Thanks in advance!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Count down

See http://xldynamic.com/source/xld.XtraTime.html

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"EW" wrote in message
...
All-
Is there a way to show in a cell in a rolling countdown. For example I
would like the timer to start at 30 mins (30:00) and countdown to 0. I

would
like to take a current cell that contains a =now() formula and replace it
with this, but the catch would be it needs to intigrate with the on-time
method so that between the on-time method running the procedure it would
count down from 30-0 min. Is there anything out there like this?

Thanks in advance!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 329
Default Count down

Hi EW,

In a new Workbook:

1. put the following subs in the 'ThisWorkbook' module-
Private Sub Workbook_Open()
BkNm = ThisWorkbook.Name
'Call StartClock
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Call StopClock
Workbooks(BkNm).Saved = True
End Sub
If you want the timer to run automatically whenever the workbook opens,
uncoment the "Call StartClock" line

2. put the following subs in a standard module-
Option Explicit
Dim NextTick
Public BkNm
Sub StartClock()
UpdateClock
End Sub

Private Sub UpdateClock()
With Windows(BkNm)
NextTick = Now + TimeValue("00:00:01")
With Workbooks(BkNm).Sheets("Clock")
Range("A1").Activate
Application.OnTime NextTick, "UpdateClock"
If Int((Range("A1").Value) - Now) = 0 Then
Range("D6").Value = Format((Range("A1").Value - Now),
"hh:mm:ss")
Else
Range("D6").Value = Int((Range("A1").Value) - Now) & " " & _
Format((Range("A1").Value - Now), "hh:mm:ss")
End If
Range("D6").Columns.ColumnWidth = _
Application.WorksheetFunction.Max(Int(Len(Trim(Ran ge("D4").Text)) *
2.5), _
Int(Len(Trim(Range("D6").Text)) * 5))
End With
End With
End Sub

Sub StopClock()
On Error Resume Next
Application.OnTime NextTick, "UpdateClock", , False
End Sub

Put the ending date & time into cell A1 (you may want to add a sub with an
InputBox for this).

As coded, the "UpdateClock" clock sub outputs in Cell D6, and formats that
cell to a width suitable for 48pt Arial. Makes it nice and large. You might
want to do something different. The wrapped line starting with
"Range("D6").Columns.ColumnWidth =" sets the cell D6 formatting.

Cheers

--
macropod
[MVP - Microsoft Word]


"EW" wrote in message
...
All-
Is there a way to show in a cell in a rolling countdown. For example I
would like the timer to start at 30 mins (30:00) and countdown to 0. I

would
like to take a current cell that contains a =now() formula and replace it
with this, but the catch would be it needs to intigrate with the on-time
method so that between the on-time method running the procedure it would
count down from 30-0 min. Is there anything out there like this?

Thanks in advance!




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
Multiple Criteria, Count If, Sum Product to get count across range Jonathan Excel Worksheet Functions 5 January 9th 08 11:32 PM
Count Employee Work Time - Don't Double-count Overlapping Apts. J Excel Worksheet Functions 0 April 27th 07 05:52 AM
Excel 2000, count, sort a list & count totals? sunslight Excel Worksheet Functions 1 April 9th 07 05:46 PM
Count Intervals of 1 Numeric value in a Row and Return Count down Column Sam via OfficeKB.com Excel Worksheet Functions 8 October 4th 05 04:37 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM


All times are GMT +1. The time now is 10:47 AM.

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"