Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -- Message posted via http://www.officekb.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Toggle Cell Colour Conditionally | Excel Worksheet Functions | |||
change a cell background colour to my own RGB colour requirements | Excel Discussion (Misc queries) | |||
Toggle AutoShape Colour | Excel Programming | |||
toggle button text colour | Excel Programming | |||
Background colour using VB | Excel Programming |