View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Excel Macro for time "Excel 2003"

Right click on the worksheet tab in question and select VIEW CODE.

Paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Target.Row = 1 Then Exit Sub

If Not Intersect(Target, Me.Range("$C:$D")) Is Nothing Then
With Target.Offset(0, -2)
.Value = Date + Time
.NumberFormat = "m/d/yyyy h:mm AM/PM"
End With
End If

End Sub

Right now, this will put a date in if anything is entered in column C or D.
If you want it to check for specific things in each column, that would
require some additional code changes for you. :) If you have questions,
come back.
--
HTH,
Barb Reinhardt




"vijay" wrote:

Hi,
I work on the excel sheet everyday and following is my probem'


A B C
D E
Start time End time Filename Status
Count
1 ? ? Amway Entered
43
2 ? ? Geo
Applied 17
3 ....... ....... .........
....... .......
and so on.
When i enter "Amway" in column "C1", The Column "A1" should automatically
show the current time of the system as "Start time". And when i key "Entered"
in column "D1" , The Column "B1" should automatically show the current time
of the system as "End time".
I would not like to use Ctrl+Shift+: for current time, for each file as
their is huge date on the daily basis. So need a help from u that would save
my time & at the same time increase in the productive.
--
vijay

----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/comm...lic.excel.misc