Neil Randall
asked on
Toggle Interior.ColorIndex using mouse clicks
I have found the following code that changes the colour of a cell when clicked to Red
This is fine, but what happens if I click the wrong cell?
What code would do the following:
Click a single cell
Check the cell has [No Fill]
If [No Fill] then fill [Red]
If [Red] then reset to [No Fill]
I think I have the logic of what I want to do, but not the knowledge of the code required.
Which is where you experts come in.
Thanks for your time
Neil
Private Sub Worksheet_SelectionChange( ByVal Target As Range)
If Target.Count = 1 Then Target.Interior.ColorIndex = 3
End Sub
This is fine, but what happens if I click the wrong cell?
What code would do the following:
Click a single cell
Check the cell has [No Fill]
If [No Fill] then fill [Red]
If [Red] then reset to [No Fill]
I think I have the logic of what I want to do, but not the knowledge of the code required.
Which is where you experts come in.
Thanks for your time
Neil
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
that is exactly what I want.
Thanks
Neil