Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I used conditional format to highlight numbers less than 1. That part works.
The cells containing numbers less than 1 appears to be highlighted, but when I test its ColorIndex, it still shows -4142, which means its blank. I even went into FormatCell and the Cell shading section was on None. So what exactly does Conditional Formatting do to the cell property that changes the color? Can I get it to change the ColorIndex? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If the condition is true CF applies the value of the ColorIndex property
of the cell's FormatCondition Object. CF doesn't (and can't) change the ColorIndex property of the cell's Interior object. If you want to know whether CF is applied, test the same condition(s) set in CF. In article , J@Y wrote: I used conditional format to highlight numbers less than 1. That part works. The cells containing numbers less than 1 appears to be highlighted, but when I test its ColorIndex, it still shows -4142, which means its blank. I even went into FormatCell and the Cell shading section was on None. So what exactly does Conditional Formatting do to the cell property that changes the color? Can I get it to change the ColorIndex? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To check the color index of a conditional format, you have to modify the code
a mite. Sub whatclr() MsgBox "ColorIndex number is " & Worksheets(1).Cells(4, 3) _ ..FormatConditions(1).Interior.ColorIndex End Sub Notice the index number after FormatConditions. It can be one of three depending on which order it was in the original CF setup. "J@Y" wrote: I used conditional format to highlight numbers less than 1. That part works. The cells containing numbers less than 1 appears to be highlighted, but when I test its ColorIndex, it still shows -4142, which means its blank. I even went into FormatCell and the Cell shading section was on None. So what exactly does Conditional Formatting do to the cell property that changes the color? Can I get it to change the ColorIndex? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I just noticed your question about changing the ColorIndex for CF. Yes, you
can change it manually and by code. Just use the FormatConditions() property in the code structure when doing it by code in the same order as my previous sample. "J@Y" wrote: I used conditional format to highlight numbers less than 1. That part works. The cells containing numbers less than 1 appears to be highlighted, but when I test its ColorIndex, it still shows -4142, which means its blank. I even went into FormatCell and the Cell shading section was on None. So what exactly does Conditional Formatting do to the cell property that changes the color? Can I get it to change the ColorIndex? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Great, that solves things. What exactly does the 1 represent int he () after
FormatConditions? "JLGWhiz" wrote: To check the color index of a conditional format, you have to modify the code a mite. Sub whatclr() MsgBox "ColorIndex number is " & Worksheets(1).Cells(4, 3) _ .FormatConditions(1).Interior.ColorIndex End Sub Notice the index number after FormatConditions. It can be one of three depending on which order it was in the original CF setup. "J@Y" wrote: I used conditional format to highlight numbers less than 1. That part works. The cells containing numbers less than 1 appears to be highlighted, but when I test its ColorIndex, it still shows -4142, which means its blank. I even went into FormatCell and the Cell shading section was on None. So what exactly does Conditional Formatting do to the cell property that changes the color? Can I get it to change the ColorIndex? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change conditional formatting to coloured alternate rows dependent on a change in date? | Excel Programming | |||
VBA ColorIndex Formatting | Excel Discussion (Misc queries) | |||
interior.colorindex used with conditional formatting | Excel Worksheet Functions | |||
conditional formatting and interior.colorindex | Excel Programming | |||
Colorindex in a Conditional Format | Excel Programming |