Does anyone know how would I change my code to make it work for multiple cells?
Right now if I change the value of AG5 it returns the recorded value on AI5 and so on. I would like to change the value of AG6 and have the value at AI6 also to be changed.... and the same if I change AG7 the record value would be at AI7..( I still want to see the changes or records for each row) Thank you again in advance.
[Dim xVal As String
Private Sub Worksheet_Change(ByVal Target As Range)
Static xCount As Integer
Application.EnableEvents = False
If Target.Address = Range("AG5").Address Then
Range("AI5").Offset(0, xCount).Value = xVal
xCount = xCount + 1
Else
If xVal <> Range("AG5").Value Then
Range("AI5").Offset(0, xCount).Value = xVal
xCount = xCount + 1
End If
End If
Application.EnableEvents = True
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
xVal = Range("AG5").Value
End Sub]
Bookmarks