Hi
I would like to have the below code amended. I have a some sheets in a workbook where I add dates in the range F2:F35 and in column G2:G35 it shows the due date then (for example F2 + 2 years), so every time I change the dates in the range F2:F35 it shows the new due date in column G2:G35. I would like to record the changes of the cells of the range F2:F35 to column P2:P35 and then to Q, R, S, T... without overwriting the old dates and only adding the dates that have changed, so that I have records of all changed dates. Is this possible? I tried to amend the below code with the ranges from C2 to F2:F35 and D2 to P2:P35, but it did not work.
I have now attached the sheet. The column F shows the current date when we overhauled parts and the column G shows the next due date (in 2 years). I want to record the dates when we overhauled parts to get a better understanding how often it was necessary to overhaul these parts before the next planned due date. I only want to record changes of the cells in column F (sorry, got the columns wrong when I posted it the first time)
Can anyone please help.
Dim xVal As String
Private Sub Worksheet_Change(ByVal Target As Range)
Static xCount As Integer
Application.EnableEvents = False
If Target.Address = Range("C2").Address Then
Range("D2").Offset(xCount, 0).Value = xVal
xCount = xCount + 1
Else
If xVal <> Range("C2").Value Then
Range("D2").Offset(xCount, 0).Value = xVal
xCount = xCount + 1
End If
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
xVal = Range("C2").Value
End Sub