Code - if T changed, change date in W to date it is changed

Code - if T changed, change date in W to date it is changed

Post by Sand » Mon, 28 Jul 2003 03:27:38


Hello!

I need code that if a value in T is changed, the date in
the corresponding row of W will change to the date it is
changed.

Any help I can get will be immensely appreciated!

Sandy
 
 
 

Code - if T changed, change date in W to date it is changed

Post by Chip Pears » Mon, 28 Jul 2003 03:32:43

Sandy,

Put the following code in the sheet module for the worksheet whose
changes you want to detect.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then
Exit Sub
End If
If Target.Column <> 20 Then
Exit Sub
End If
Target(1, 4).Value = Now
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com XXXX@XXXXX.COM

 
 
 

Code - if T changed, change date in W to date it is changed

Post by Sand » Tue, 29 Jul 2003 01:33:12

Dear Chip:

Thanks for your response. Works well, although I don't
understand exactly how it works. Could you briefly
describe what it's doing? I'm rusty in my VBA at the
moment.

Can this be taken one step further so that essentially,
clicking on the cell is not enough to change it, but the
actual change of the value will institute the date change?

Sandy

worksheet whose