Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Run this macro.
Sub ListColorIndexes() Dim Ndx As Long Sheets.Add For Ndx = 1 To 56 Cells(Ndx, 1).Interior.ColorIndex = Ndx Cells(Ndx, 2).Value = Hex(ThisWorkbook.Colors(Ndx)) Cells(Ndx, 3).Value = Ndx Next Ndx End Sub Gord On Tue, 3 Mar 2009 13:56:30 -0800, Stan wrote: Works Great! Do you know how I can tell what the ColorIndex is for each color? I see that 3 = Red but I also need Green, Blue, Orange, and Yellow. "Gord Dibben" wrote: Sub do_something() If ActiveCell.Interior.ColorIndex = 3 Then MsgBox "What now?" 'run a macro or do something Else MsgBox "Not Red!" 'do nothing and exit End If End Sub Gord Dibben MS Excel MVP On Tue, 3 Mar 2009 12:57:01 -0800, Stan wrote: Can someone help me by telling me how I can refer to a cell's color and the perform an action? In other words, if a cell is red, then docmd.xxxxx? Many thanks! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
VBA code question | Excel Discussion (Misc queries) | |||
vb code question | Excel Programming | |||
vb code question | Excel Discussion (Misc queries) | |||
vb code question | Excel Discussion (Misc queries) |