Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
k3639
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.misc
k3639
 
Posts: n/a
Default 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
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
Formula Question Marcus Feldmore Excel Worksheet Functions 1 November 11th 05 03:47 PM
Formula question Dawn Excel Discussion (Misc queries) 1 November 8th 05 06:56 PM
I have a question regarding countif formula. Fahad Farid Ansari Excel Worksheet Functions 6 October 1st 05 11:57 PM
An Excel Formula Question JWCardington Excel Worksheet Functions 6 September 24th 05 09:00 PM
Formula Question JDT Excel Discussion (Misc queries) 2 January 30th 05 01:17 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"