I found code here (that I modified) that returns the date a cell was last modified (in another cell two rows down), but it only works if you manually change the value of the cell. Here is the code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("I6:I7,J6:J7"), Target) Is Nothing Then
Exit Sub
End If
Application.EnableEvents = False
Target.Offset(2, 0).Value = Now()
Application.EnableEvents = True
End Sub
What I need is code that will do the same thing (8 rows down in this case), but works when the cell is referencing a completely different workbook and updates when a new version of the file is saved to the folder. I tried the code above, and it only works if you manually change the value of a cell (not when it is automatically updated).
Any ideas?
I have 16 different cells I need to do this for (in addition to the 2 that are manually updated in the worksheet). It appears you can have only one Private Sub Worksheet_Change(ByVal Target As Range) entry in the worksheet code, so I need code that will handle all 18 cells that can be changed.
* NOTE: This is a dashboard that is calculating various metrics based on data from other workbooks that are saved over the existing version in a folder that comes in via email monthly from different sources.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("I6:I7,J6:J7"), Target) Is Nothing Then
Exit Sub
End If
Application.EnableEvents = False
Target.Offset(2, 0).Value = Now()
Application.EnableEvents = True
End Sub
What I need is code that will do the same thing (8 rows down in this case), but works when the cell is referencing a completely different workbook and updates when a new version of the file is saved to the folder. I tried the code above, and it only works if you manually change the value of a cell (not when it is automatically updated).
Any ideas?
I have 16 different cells I need to do this for (in addition to the 2 that are manually updated in the worksheet). It appears you can have only one Private Sub Worksheet_Change(ByVal Target As Range) entry in the worksheet code, so I need code that will handle all 18 cells that can be changed.
* NOTE: This is a dashboard that is calculating various metrics based on data from other workbooks that are saved over the existing version in a folder that comes in via email monthly from different sources.