noexcelguru
New Member
- Joined
- Jan 18, 2011
- Messages
- 40
I'm trying to get a CheckBox to find cells with certain values (variable1-4 in the code) and highlight the first cell of the row or the entire row ("A:Q") in orange (CI 45) and remove the color once unchecked.
Is it possible to range the entire column ("E:E"), and not just a specified number of rows down, like ("E7:E5000") in the code?
I've made this code, obviousley it doesn't work, but it might help you to get a clearer picture of what i would like the CheckBox to do
Is it possible to range the entire column ("E:E"), and not just a specified number of rows down, like ("E7:E5000") in the code?
I've made this code, obviousley it doesn't work, but it might help you to get a clearer picture of what i would like the CheckBox to do
Code:
Private Sub CheckBox1_Click()
If CheckBox1.Value = False Then
If ("E7:E5000") = "Variable1" Or "Variable2" Or "Variable3" Or "Variable4" Then
firscellofrow = Cells.Interior.ColorIndex = xlNone
End If
End If
If CheckBox1.Value = True Then
If ("E7:E5000") = "Variable1" Or "Variable2" Or "Variable3" Or "Variable4" Then
firscellsofrow = Cells.Interior.ColorIndex = 45
End If
End If
End Sub