I'm looking to populate a field with the last date a row was updated. Currently, I have data in columns A - J and if any of those are updated for a given row, I would like column K of that row to be updated with that date. (I'm fine with date and time as well if that is easier). This is a spreadsheet of contact information and I want to be able to easily tell the last time I (or any user of the spreadsheet) updated the contact information for a given entry.
I have tried:
**AND**
[/FONT]
[FONT="]But get an error of "Argument Not Optional"
I have tried
[/FONT]
And it works, but it updates cell E7 any time any cell in the entire document is updated.
Can someone help me modify the code that worked, so that it has the limitations I require? If that's not possible, can you provide me step by step instructions of what I need to make this work? (Commented out details of what each line of code is actually doing a bonus.)
This is my first attempt at VBA so step by step instructions are greatly appreciated.
THANKS!
I have tried:
[FONT="]Private Sub Worksheet_Change(ByVal Target As Range)[/FONT]
[FONT="]If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub[/FONT]
[FONT="]If Not Intersect(Target, Columns("B:D")) Is Nothing Then[/FONT]
[FONT="] On Error Resume Next[/FONT]
[FONT="] Application.EnableEvents = False[/FONT]
[FONT="] Cells(Target.Row, 7) = Now[/FONT]
[FONT="] Cells(Target.Row, 7).EntireColumn.AutoFit[/FONT]
[FONT="] Application.EnableEvents = True[/FONT]
[FONT="] On Error GoTo 0[/FONT]
[FONT="] End If[/FONT]
[FONT="]End Sub
[/FONT]
[FONT="][FONT="]If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub[/FONT]
[FONT="]If Not Intersect(Target, Columns("B:D")) Is Nothing Then[/FONT]
[FONT="] On Error Resume Next[/FONT]
[FONT="] Application.EnableEvents = False[/FONT]
[FONT="] Cells(Target.Row, 7) = Now[/FONT]
[FONT="] Cells(Target.Row, 7).EntireColumn.AutoFit[/FONT]
[FONT="] Application.EnableEvents = True[/FONT]
[FONT="] On Error GoTo 0[/FONT]
[FONT="] End If[/FONT]
[FONT="]End Sub
[/FONT]
**AND**
[/FONT]
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Cells(Target.Row, "A").Value = Now()
Application.EnableEvents = True
End Sub
[FONT="]But get an error of "Argument Not Optional"
I have tried
[/FONT]
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Range("E7") = Now()
Application.EnableEvents = True
End Sub
And it works, but it updates cell E7 any time any cell in the entire document is updated.
Can someone help me modify the code that worked, so that it has the limitations I require? If that's not possible, can you provide me step by step instructions of what I need to make this work? (Commented out details of what each line of code is actually doing a bonus.)
This is my first attempt at VBA so step by step instructions are greatly appreciated.
THANKS!