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

  • Thread starter Thread starter Sandy
  • Start date Start date
S

Sandy

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
 
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 (e-mail address removed)
 
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
 
Back
Top