Hi,
Below is VBA I have placed on a few sheet. Problem is when it's loaded I can't right click within the sheet unless I remove it.
I think it would help to have a button to turn it off and on as needed. Or on by default, with an off button.
'CELL SELECTION CHANGES COLOUR
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Select Case Target.Interior.ColorIndex
Case xlNone, 45: Target.Interior.ColorIndex = 4
Case 4: Target.Interior.ColorIndex = 17
Case 17: Target.Interior.ColorIndex = 45
Case Else: Target.Interior.ColorIndex = xlNone
End Select
End Sub
'CELL SELECTION CHANGES COLOUR
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.ColorIndex = xlNone
End Sub
Below is VBA I have placed on a few sheet. Problem is when it's loaded I can't right click within the sheet unless I remove it.
I think it would help to have a button to turn it off and on as needed. Or on by default, with an off button.
'CELL SELECTION CHANGES COLOUR
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Select Case Target.Interior.ColorIndex
Case xlNone, 45: Target.Interior.ColorIndex = 4
Case 4: Target.Interior.ColorIndex = 17
Case 17: Target.Interior.ColorIndex = 45
Case Else: Target.Interior.ColorIndex = xlNone
End Select
End Sub
'CELL SELECTION CHANGES COLOUR
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Cancel = True
Target.Interior.ColorIndex = xlNone
End Sub