Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / January 2007

Tip: Looking for answers? Try searching our database.

CLick on Box to enter time of day

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Elfego Baca - 24 Jan 2007 01:16 GMT
I have a worksheet where payment is entered in column C. I would like to
use Column B as a time stamp. In other words as soon as data is entered
in C5 then the exact time comes up in B5. When data is entered in C6
then the exact time cones up in C5. I do not want this time to change
even when the page is saved and opened later on.
Gord Dibben - 24 Jan 2007 01:22 GMT
Elfego

You can enter a static time in a cell by hitting CTRL + SHIFT + ;(semi-colon)

You could also use event code to enter a static date when you enter something in
a cell.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col C
On Error GoTo enditall
   Application.EnableEvents = False
If Target.Cells.Column = 3 Then
       n = Target.Row
       If Excel.Range("C" & n).Value <> "" Then
           Excel.Range("B" & n).Value = Format(Now, "hh:mm:ss")
       End If
   End If
enditall:
   Application.EnableEvents = True
End Sub

This is sheet event code.  Right-click on the sheet tab and "View Code"

Copy/paste the above into that module.

Enter a value in C1 and B1 will return a static date.

Gord Dibben  MS Excel MVP

>I have a worksheet where payment is entered in column C. I would like to
>use Column B as a time stamp. In other words as soon as data is entered
>in C5 then the exact time comes up in B5. When data is entered in C6
>then the exact time cones up in C5. I do not want this time to change
>even when the page is saved and opened later on.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.