F
Francois via OfficeKB.com
I'm trying to toggle the background colour of cells between whatever colour
they were to xlColorIndexNone and back again.
My code does it for one specified colour, but I can't work out how to modify
it for any other colours it may encounter.
Option Explicit
Dim lastCell As Range
Private Sub Worksheet_BEFOREDOUBLECLICK(ByVal Target As Range, CANCEL As
Boolean)
If Target.Interior.ColorIndex = 36 Then
Target.Interior.ColorIndex = xlColorIndexNone
Else: Target.Interior.ColorIndex = 36
End If
End Sub
I realise that I need to get the colorindex somewhere, but I'm not getting it
right
Thanks in advance
they were to xlColorIndexNone and back again.
My code does it for one specified colour, but I can't work out how to modify
it for any other colours it may encounter.
Option Explicit
Dim lastCell As Range
Private Sub Worksheet_BEFOREDOUBLECLICK(ByVal Target As Range, CANCEL As
Boolean)
If Target.Interior.ColorIndex = 36 Then
Target.Interior.ColorIndex = xlColorIndexNone
Else: Target.Interior.ColorIndex = 36
End If
End Sub
I realise that I need to get the colorindex somewhere, but I'm not getting it
right
Thanks in advance