Dear all,
I have a macro that would change:- White cell to Red
- Red cell to White
- Any other coloured cell to Red
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Select Case Target.Interior.ColorIndex
Case Is = xlNone: Target.Interior.ColorIndex = 3 'if white, then colour red
Case Else: Select Case Target.Interior.ColorIndex
Case Is = 3: Target.Interior.ColorIndex = xlNone 'if red, then colour white
Case Else: Target.Interior.ColorIndex = 3 'if other colours besides red, colour red
End Select
End Select
Cancel = True
End Sub
However, I would like to store the original colour of the cell, such that on the 1st double click, the cell becomes Red. On the 2nd double click, the cell changes back to the original colour.
Does anybody know how to achieve this? Any ideas will be greatly appreciated. Thanks!
Bookmarks