(DISCLAIMER: I'm a total noob at VBA)
I want to update a "date updated" column automatically whenever I change the contents of one or both of two other columns on a single worksheet. Specifically, if I change the contents of a cell in column A or in column C, I want the "Date Updated" cell in the same row (Column B) to change to today's date. Can I do this?
In researching if it was possible to automatically change the date, I found a post on this site that I modified (because it changed a cell in a different location on the page) and was able to make it work for a single column, but not sure how to do it for two different columns. I created a test worksheet to see if I could make it work. Here's what I have:
Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Target.Offset(0, 1) = Now
End If
End Sub
If I make a change in column A, the date in Column B changes to today's date correctly.
I want to update a "date updated" column automatically whenever I change the contents of one or both of two other columns on a single worksheet. Specifically, if I change the contents of a cell in column A or in column C, I want the "Date Updated" cell in the same row (Column B) to change to today's date. Can I do this?
In researching if it was possible to automatically change the date, I found a post on this site that I modified (because it changed a cell in a different location on the page) and was able to make it work for a single column, but not sure how to do it for two different columns. I created a test worksheet to see if I could make it work. Here's what I have:
Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Target.Offset(0, 1) = Now
End If
End Sub
If I make a change in column A, the date in Column B changes to today's date correctly.