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

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
 
C

Chip Pearson

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)
 
S

Sandy

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
 

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