Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
changing a cell to different colors
I have an excel worksheet that i am trying to code to make it cycle through 3
different colors (yellow, green and red) by double clicking on the cell, all it does is keep it blank....here is the code that i have in the sheet right now. As well i would like this to apply to only certain cells, (i dont know how to define the range, its been a really long time since i worked with this) HELP!!! Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) If ActiveCell.Interior.ColorIndex = xlNone Then ActiveCell.Interior.ColorIndex = 6 End If If ActiveCell.Interior.ColorIndex = 6 Then ActiveCell.Interior.ColorIndex = 4 End If If ActiveCell.Interior.ColorIndex = 4 Then ActiveCell.Interior.ColorIndex = 3 End If If ActiveCell.Interior.ColorIndex = 3 Then ActiveCell.Interior.ColorIndex = xlNone End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Changing cell colors | Excel Discussion (Misc queries) | |||
changing colors of a cell | Excel Programming | |||
Changing cell colors in a row IF... | Excel Programming | |||
Changing cell colors in a row IF... | Excel Programming | |||
Changing the colors of a cell | Excel Programming |