I have this Sheet, where I want to change the backcolor of a command button, as soon as any values in range A2:A10 are CHANGED.
The issue with the code below is that the color changes as soon as any of these cells A2 through A10 are SELECTED. I don't want this, I only want a color change when the value changes.
Thanks.
The issue with the code below is that the color changes as soon as any of these cells A2 through A10 are SELECTED. I don't want this, I only want a color change when the value changes.
Thanks.
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim i As Integer
i = Target.Row
If i >= 2 And i <= 10 Then
If Target.Column = 1 Then
CommandButton1.BackColor = RGB(100, 100, 0)
End If
End If
End Sub