Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 48 hour timer

I have tried several different options that I have found online, but still
can't quite get Excel to do what I need. I am looking for a way to count
down 48 hours from from when a date is entered into a specific cell. Anyone
have any ideas. Thanks in advance for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 48 hour timer

Hi Jason

Unclear what you want and how it's supposed to work. But rightclick sheet
tab, go "view code", paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Dt As Date
If Target.Address(False, False, xlA1) = "A1" Then
Dt = Now + 2
Range("B1").FormulaR1C1 = _
"=DATE(" & Year(Dt) & "," & _
Month(Dt) & "," & _
Day(Dt) & ")+TIME(" & _
Hour(Dt) & "," & _
Minute(Dt) & "," & _
Second(Dt) & ")-NOW()"
Range("B1").NumberFormat = "[hh]:mm:ss"
End If
End Sub

Now it enters a new countdown formula in B1 at each new A1 entry, and it
changes on each recalculation (entry in other cell or F9).

If you however want this to tick every second, it requires a macro loop that
introduces unwanted effects.

It this works, click the "Yo da man" button.

HTH. Best wishes Harald

"Jason Lindner" <Jason skrev i melding
...
I have tried several different options that I have found online, but still
can't quite get Excel to do what I need. I am looking for a way to count
down 48 hours from from when a date is entered into a specific cell.
Anyone
have any ideas. Thanks in advance for your help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 48 hour timer

This is very close to what I need, thank you. To further clarify, I have a
whole list of projects that are in rows. I need to have a timer for each
project. Is there a way to do this without having to hard set the cells, or
create separate code for each row?

Thanks.

"Harald Staff" wrote:

Hi Jason

Unclear what you want and how it's supposed to work. But rightclick sheet
tab, go "view code", paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Dt As Date
If Target.Address(False, False, xlA1) = "A1" Then
Dt = Now + 2
Range("B1").FormulaR1C1 = _
"=DATE(" & Year(Dt) & "," & _
Month(Dt) & "," & _
Day(Dt) & ")+TIME(" & _
Hour(Dt) & "," & _
Minute(Dt) & "," & _
Second(Dt) & ")-NOW()"
Range("B1").NumberFormat = "[hh]:mm:ss"
End If
End Sub

Now it enters a new countdown formula in B1 at each new A1 entry, and it
changes on each recalculation (entry in other cell or F9).

If you however want this to tick every second, it requires a macro loop that
introduces unwanted effects.

It this works, click the "Yo da man" button.

HTH. Best wishes Harald

"Jason Lindner" <Jason skrev i melding
...
I have tried several different options that I have found online, but still
can't quite get Excel to do what I need. I am looking for a way to count
down 48 hours from from when a date is entered into a specific cell.
Anyone
have any ideas. Thanks in advance for your help.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 48 hour timer

For further clarification, here is an example of what I am trying to do:

Project A 1/21/09
Project B 1/23/09

I need a timer that will count down 48 hours from the time I entered the
date of 1/21/09 or 1/23/09. I am trying to set up a type of alarm that
another task must be completed within 48 hours of that date being entered in
column AL.

Thanks so much.

"Jason Lindner" wrote:

This is very close to what I need, thank you. To further clarify, I have a
whole list of projects that are in rows. I need to have a timer for each
project. Is there a way to do this without having to hard set the cells, or
create separate code for each row?

Thanks.

"Harald Staff" wrote:

Hi Jason

Unclear what you want and how it's supposed to work. But rightclick sheet
tab, go "view code", paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim Dt As Date
If Target.Address(False, False, xlA1) = "A1" Then
Dt = Now + 2
Range("B1").FormulaR1C1 = _
"=DATE(" & Year(Dt) & "," & _
Month(Dt) & "," & _
Day(Dt) & ")+TIME(" & _
Hour(Dt) & "," & _
Minute(Dt) & "," & _
Second(Dt) & ")-NOW()"
Range("B1").NumberFormat = "[hh]:mm:ss"
End If
End Sub

Now it enters a new countdown formula in B1 at each new A1 entry, and it
changes on each recalculation (entry in other cell or F9).

If you however want this to tick every second, it requires a macro loop that
introduces unwanted effects.

It this works, click the "Yo da man" button.

HTH. Best wishes Harald

"Jason Lindner" <Jason skrev i melding
...
I have tried several different options that I have found online, but still
can't quite get Excel to do what I need. I am looking for a way to count
down 48 hours from from when a date is entered into a specific cell.
Anyone
have any ideas. Thanks in advance for your help.




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
Converting from 12-hour to 24-hour format Nathan Excel Worksheet Functions 2 July 15th 08 03:51 PM
Overtime for 8 hour and 40 hour Curtis Excel Discussion (Misc queries) 1 June 7th 07 07:32 PM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 12:08 PM
convert decimal numbers to a fraction of an hour for payroll hour Flower Excel Worksheet Functions 4 February 10th 06 07:46 PM
How can I round an hour to the nearest 1/4 hour? Ms Chewie Excel Worksheet Functions 5 December 21st 04 05:05 AM


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