PC Review


Reply
Thread Tools Rate Thread

add a timer to my template

 
 
=?Utf-8?B?QUpC?=
Guest
Posts: n/a
 
      24th Jul 2007
I am a cost estimator who works on 2-12 bids a week and I want to add a timer
to my template that simply counts up from zero while the workbook is open
(and cumulatively each time opened) so I can compare my time usage vs. job
profit estimated.

I am a programming rookie, thanks for your assistance.
 
Reply With Quote
 
 
 
 
JE McGimpsey
Guest
Posts: n/a
 
      25th Jul 2007
One way:

Put this the ThisWorkbook Code module:


Private Sub Workbook_Open()
StartCounting bStart:=True
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopCounting
End Sub

Put this in a regular code module:

Public dNextCall As Double

Public Sub StartCounting(Optional bStart As Boolean = False)
Const dINCREMENT As Date = #00:01:00#
If Not bStart Then
With Sheets("Sheet1").Range("A1")
.Value = .Value + dINCREMENT
End With
End If
dNextCall = Now + dINCREMENT
Application.OnTime dNextCall, "StartCounting", Schedule:=True
End Sub

Public Sub StopCounting()
Application.OnTime dNextCall, "StartCounting", Schedule:=False
End Sub

Change the Sheet and range, and the increment, to suit.

In article <F9530E4B-7470-4577-9E24-(E-Mail Removed)>,
AJB <(E-Mail Removed)> wrote:

> I am a cost estimator who works on 2-12 bids a week and I want to add a timer
> to my template that simply counts up from zero while the workbook is open
> (and cumulatively each time opened) so I can compare my time usage vs. job
> profit estimated.
>
> I am a programming rookie, thanks for your assistance.

 
Reply With Quote
 
=?Utf-8?B?QUpC?=
Guest
Posts: n/a
 
      27th Jul 2007
that works perfectly, thank you.


"JE McGimpsey" wrote:

> One way:
>
> Put this the ThisWorkbook Code module:
>
>
> Private Sub Workbook_Open()
> StartCounting bStart:=True
> End Sub
>
> Private Sub Workbook_BeforeClose(Cancel As Boolean)
> StopCounting
> End Sub
>
> Put this in a regular code module:
>
> Public dNextCall As Double
>
> Public Sub StartCounting(Optional bStart As Boolean = False)
> Const dINCREMENT As Date = #00:01:00#
> If Not bStart Then
> With Sheets("Sheet1").Range("A1")
> .Value = .Value + dINCREMENT
> End With
> End If
> dNextCall = Now + dINCREMENT
> Application.OnTime dNextCall, "StartCounting", Schedule:=True
> End Sub
>
> Public Sub StopCounting()
> Application.OnTime dNextCall, "StartCounting", Schedule:=False
> End Sub
>
> Change the Sheet and range, and the increment, to suit.
>
> In article <F9530E4B-7470-4577-9E24-(E-Mail Removed)>,
> AJB <(E-Mail Removed)> wrote:
>
> > I am a cost estimator who works on 2-12 bids a week and I want to add a timer
> > to my template that simply counts up from zero while the workbook is open
> > (and cumulatively each time opened) so I can compare my time usage vs. job
> > profit estimated.
> >
> > I am a programming rookie, thanks for your assistance.

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a day timer template in word or excel? Lisa Microsoft Excel Misc 0 2nd Jan 2008 03:59 PM
Array of System.Timers.timer - Assigning an object to timer Gina_Marano Microsoft C# .NET 2 8th Mar 2007 12:51 AM
template timer stopwatch =?Utf-8?B?d2FtYXk=?= Microsoft Excel Worksheet Functions 1 15th Apr 2006 10:24 PM
How to pause the timer created from System.Threading.Timer class =?Utf-8?B?RGhydXZlc2ggQnJhaG1iaGF0dA==?= Microsoft Dot NET Framework 4 29th Mar 2006 12:05 PM
System.Timers.Timer bug : timer fires immediately/continously felix Microsoft Dot NET Framework 2 25th Apr 2005 06:48 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:38 AM.