How to auto insert date in one cell when another is changed

J

Jim

I'd like to automatically put the date into cell P2 whenever the data in cell
N2 is changed. I'd like to do the same for P3-N3.

I found the VBA code to do this for a whole column, but I only want to do
just these two indivual cells.

I've tried the following, but doesn't work:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("N2")) Is Nothing Then
Exit Sub
Else
P2 = Now()
End If
End Sub

I know enough about VBA to be dangerous, so please try and be as detailed as
possible in your suggestions.

Many thanks,

JIM
 
R

Roger Govier

see response to your previous posting.
I showed a slight modification to Bernie Deitrick's code to allow you to do
this
 
Joined
May 24, 2011
Messages
1
Reaction score
0
I'd like to automatically put the date into cell P2 whenever the data in cell
N2 is changed. I'd like to do the same for P3-N3.

I found the VBA code to do this for a whole column, but I only want to do
just these two indivual cells.

I've tried the following, but doesn't work:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("N2")) Is Nothing Then
Exit Sub
Else
P2 = Now()
End If
End Sub

I know enough about VBA to be dangerous, so please try and be as detailed as
possible in your suggestions.

Many thanks,

JIM
I don´t have an idea about it...But actually I´m looking for a code to do that for a whole column...What you found I guess; can you please tell me how it is?

Regards,

Joseph
 

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