To Capture the time stamp on entry of a value in cell.

  • Thread starter Khozema Sherwala
  • Start date
K

Khozema Sherwala

Hi,

I am trying to capture the time on the entry of the cell in column A.
Scenario is I enter a person code in cell in A column and in B column I need
a time stamp. I am using now(). It works for one row. but as i proceed to
scan further all the values in column b is getting updated as i am using
now(). I want to capture time stamp for each entry of person code in col A
and then freeze timestamp in col b and proceed. I am trying to get something
like,

A1
3031
B1
10:30 Pm
A2
3032
B2
10:35 PM
and so on...

Any pointer or help here will help me. Thanks in advance.

best regards,
 
P

Phuelgod

Try this:

Private Sub Worksheet_Change(ByVal target As Range)

If target.Column = 1 Then target.Offset(0, 1).Value = Now()

End Sub
 
K

Khozema Sherwala

Thanks it works. I understand the range type is being used and if my cursor
is on first column then only time is populated in the next column cell values
only.

It works for my today's assignment. Thanks Phuelgod.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top