Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
If/Then Formula Question
I am attempting to create a timesheet, where if a particular cell is clicked
on, the current time/date stamp will generate via the Now() function. I am having trouble with how to indicate that the timestamp should be entered if the cell is clicked on. Also, can the timestamp be displayed in the same cell, take cell A1 for example. Any assistance is appreciated. I have both 2000 and 2003 available. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
If/Then Formula Question
Put the following code in the worksheet's code module
(right-click the tab and choose View Code). Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Target If .Address = "$A$1" Then .Value = Now .NumberFormat = "hh:mm:ss" End If End With End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "k3639" wrote in message ... I am attempting to create a timesheet, where if a particular cell is clicked on, the current time/date stamp will generate via the Now() function. I am having trouble with how to indicate that the timestamp should be entered if the cell is clicked on. Also, can the timestamp be displayed in the same cell, take cell A1 for example. Any assistance is appreciated. I have both 2000 and 2003 available. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
If/Then Formula Question
Thanks for your assistance, that works perfectly!
"Chip Pearson" wrote: Put the following code in the worksheet's code module (right-click the tab and choose View Code). Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Target If .Address = "$A$1" Then .Value = Now .NumberFormat = "hh:mm:ss" End If End With End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "k3639" wrote in message ... I am attempting to create a timesheet, where if a particular cell is clicked on, the current time/date stamp will generate via the Now() function. I am having trouble with how to indicate that the timestamp should be entered if the cell is clicked on. Also, can the timestamp be displayed in the same cell, take cell A1 for example. Any assistance is appreciated. I have both 2000 and 2003 available. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula Question | Excel Worksheet Functions | |||
Formula question | Excel Discussion (Misc queries) | |||
I have a question regarding countif formula. | Excel Worksheet Functions | |||
An Excel Formula Question | Excel Worksheet Functions | |||
Formula Question | Excel Discussion (Misc queries) |