Mister Metzger
New Member
- Joined
- Mar 18, 2016
- Messages
- 10
Hi all,
Long time viewer, first time poster, haha. I can't even begin to say how much the posts here have helped me out at work. What I'm trying to accomplish is that when the value of a cell in column C changes, the cell adjacent to the changed cell is time-stamped with the time of the change. The VBA I'm currently using is:
<!--[if !supportLineBreakNewLine]-->
But, it will only add a time stamp if the change is manual and not as a result of a formula. I can't change the target to the source data because it changes every row and the sources are also formulas. The closest vba I've been able to find that might help with this is:
But I don't know how to fully integrate this with my existing code, since the top one uses intersects and targets. Some additional information on my spreadsheet:
Columns A & B - Formulas referencing cells from various parts of the file. Each reference is different and the referenced cells are also formulas.
Column C - Formula to find the absolute difference between Columns A & B
Column D - Time stamp of the time a given cell in column C last changed
Thank you for any help you can provide. I hope this isn't too scattered. If there is anything else I can provide, please let me know.
Kind regards,
MM
Long time viewer, first time poster, haha. I can't even begin to say how much the posts here have helped me out at work. What I'm trying to accomplish is that when the value of a cell in column C changes, the cell adjacent to the changed cell is time-stamped with the time of the change. The VBA I'm currently using is:
<!--[if !supportLineBreakNewLine]-->
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C:C")) Is Nothing Then
Target(1, 2) = Now()
Target(1, 2).EntireColumn.AutoFit
End If
End Sub
But, it will only add a time stamp if the change is manual and not as a result of a formula. I can't change the target to the source data because it changes every row and the sources are also formulas. The closest vba I've been able to find that might help with this is:
Code:
Private Sub Worksheet_Calculate()
Static oldval
If Range("C1").Value <> oldval Then
oldval = Range("C1").Value
'
'rest of your code here
'
End If
End Sub
But I don't know how to fully integrate this with my existing code, since the top one uses intersects and targets. Some additional information on my spreadsheet:
Columns A & B - Formulas referencing cells from various parts of the file. Each reference is different and the referenced cells are also formulas.
Column C - Formula to find the absolute difference between Columns A & B
Column D - Time stamp of the time a given cell in column C last changed
Thank you for any help you can provide. I hope this isn't too scattered. If there is anything else I can provide, please let me know.
Kind regards,
MM