Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Conditional formatting to change ColorIndex?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Conditional formatting to change ColorIndex?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Conditional formatting to change ColorIndex?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Conditional formatting to change ColorIndex?

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   Report Post  
Posted to microsoft.public.excel.programming
J@Y J@Y is offline
external usenet poster
 
Posts: 127
Default Conditional formatting to change ColorIndex?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change conditional formatting to coloured alternate rows dependent on a change in date? StargateFan[_3_] Excel Programming 4 August 2nd 06 11:28 AM
VBA ColorIndex Formatting [email protected] Excel Discussion (Misc queries) 5 February 20th 06 03:38 PM
interior.colorindex used with conditional formatting Wazooli Excel Worksheet Functions 7 February 25th 05 01:01 AM
conditional formatting and interior.colorindex Wazooli Excel Programming 1 February 24th 05 05:53 PM
Colorindex in a Conditional Format Frank Kabel Excel Programming 3 July 23rd 04 09:18 PM


All times are GMT +1. The time now is 07:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"