Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Converting from 12-hour to 24-hour format | Excel Worksheet Functions | |||
Overtime for 8 hour and 40 hour | Excel Discussion (Misc queries) | |||
Stopping a Timer / Running a timer simultaneously on Excel | Excel Discussion (Misc queries) | |||
convert decimal numbers to a fraction of an hour for payroll hour | Excel Worksheet Functions | |||
How can I round an hour to the nearest 1/4 hour? | Excel Worksheet Functions |