Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reading conditional format that is active in VB

I have some code that checks the Interior.ColorIndex of a cell and
acts upon the result. No problem.

I thought that I could alter the Pattern colour (i.e.
Interior.ColorIndex) with a conditional format. I have. No problem.

However the code that acts upon the Interior.ColorIndex does not
detect the changed ColorIndex when it is altered due to the
Conditional Formatting. It reads the value that is set when no
conditional formatting is active (even if it is).

So I need to detect for a conditional format as well. However
..FormatConditions method does not provide any way to read which if any
of the FormatConditions is currently active.

[Aside] Ideally .Interior would return what is currently the case due
to conditional formatting or not. Another method say .InteriorDefault
would yield what we are currently getting. Anyway this is not the case
so I'm fishing for a work around.

Any suggestions
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Reading conditional format that is active in VB

Hi Chris,

Check instead for the conditional format condition(s).


---
Regards,
Norman



"Chris" wrote in message
m...
I have some code that checks the Interior.ColorIndex of a cell and
acts upon the result. No problem.

I thought that I could alter the Pattern colour (i.e.
Interior.ColorIndex) with a conditional format. I have. No problem.

However the code that acts upon the Interior.ColorIndex does not
detect the changed ColorIndex when it is altered due to the
Conditional Formatting. It reads the value that is set when no
conditional formatting is active (even if it is).

So I need to detect for a conditional format as well. However
.FormatConditions method does not provide any way to read which if any
of the FormatConditions is currently active.

[Aside] Ideally .Interior would return what is currently the case due
to conditional formatting or not. Another method say .InteriorDefault
would yield what we are currently getting. Anyway this is not the case
so I'm fishing for a work around.

Any suggestions



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reading conditional format that is active in VB

Checking for the condition(s) in the code is no viable because the
conditions are not of that sell but of other relative cells. Add/Remove
a column or row and the code will be out. There are ways round this with
named ranges but it is getting bigger and uglier to solve what should be
simple.

It is however the only solution so far.

The other way is to read the condition formula and parse it / interprit
it so check for the condition 'again' in code. Any code tips how to
achieve this?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Reading conditional format that is active in VB

Put on your hardhat and visit Chip Pearson's site:

http://www.cpearson.com/excel/CFColors.htm


Chris wrote:

I have some code that checks the Interior.ColorIndex of a cell and
acts upon the result. No problem.

I thought that I could alter the Pattern colour (i.e.
Interior.ColorIndex) with a conditional format. I have. No problem.

However the code that acts upon the Interior.ColorIndex does not
detect the changed ColorIndex when it is altered due to the
Conditional Formatting. It reads the value that is set when no
conditional formatting is active (even if it is).

So I need to detect for a conditional format as well. However
.FormatConditions method does not provide any way to read which if any
of the FormatConditions is currently active.

[Aside] Ideally .Interior would return what is currently the case due
to conditional formatting or not. Another method say .InteriorDefault
would yield what we are currently getting. Anyway this is not the case
so I'm fishing for a work around.

Any suggestions


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Reading conditional format that is active in VB

It makes no difference where the conditions are, you just check anyway.

For instance, if the CF says =E17=12, then you check E12 in the code, not
the cell where the CF is.

Testing for the CF colorindex is remarkably tricky, and not robust. Norman's
suggestion is sounder.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Chris" wrote in message
...
Checking for the condition(s) in the code is no viable because the
conditions are not of that sell but of other relative cells. Add/Remove
a column or row and the code will be out. There are ways round this with
named ranges but it is getting bigger and uglier to solve what should be
simple.

It is however the only solution so far.

The other way is to read the condition formula and parse it / interprit
it so check for the condition 'again' in code. Any code tips how to
achieve this?


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



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
Formula not reading date format ziak Excel Discussion (Misc queries) 3 May 20th 10 09:41 PM
Cell format on reading .csv file sdawson Excel Discussion (Misc queries) 3 July 20th 09 06:09 PM
Conditional Format to Highlight the Active Cell Pawprint Excel Worksheet Functions 1 July 30th 08 09:03 PM
reading blank cell as active - how can I stop it ? Nu-bEE Excel Discussion (Misc queries) 1 March 20th 05 10:45 PM
Determining active conditional format of one cell Antonio[_3_] Excel Programming 1 November 27th 03 12:38 AM


All times are GMT +1. The time now is 03:44 PM.

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

About Us

"It's about Microsoft Excel"