Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default recognizing conditional formatting with VBA

Hello group.

Came across a situation today which I couldn't resolve to my
satisfaction. Maybe someone here can help...

A colleague needed me to code a spreadsheet with a fairly simple
requirement. If a certain cell was green, the entire row would be
colored green; if the cell was red, the entire row would be shaded
red. The issue is the cell I'm basing everything off of is
conditionally formatted. Trying to recognize the cell's color via
cell.interior.colorindex does not work.

I was unable to get any code to recognize the conditionally formatted
cell. I finally resolved my problem by eliminating the conditional
formatting and hardcoding the conditionally formatted formulas into
the VBA module.

So, does anyone know of a method to get VBA to recognize a
conditionally formatted cell?

Art
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default recognizing conditional formatting with VBA

You cannot "see" the formatting resulting being applied to a cell from
Conditional Formatting directly. The best you can do is have your code
perform the same test that the Conditional Formatting is doing... if your
test is True then so is the one the Conditional Formatting is evaluating, so
then you know it is applying whatever formatting to the cell that was
specified.

Rick Rothstein (MVP - Excel)


"c1802362" wrote in message
...

Hello group.

Came across a situation today which I couldn't resolve to my
satisfaction. Maybe someone here can help...

A colleague needed me to code a spreadsheet with a fairly simple
requirement. If a certain cell was green, the entire row would be
colored green; if the cell was red, the entire row would be shaded
red. The issue is the cell I'm basing everything off of is
conditionally formatted. Trying to recognize the cell's color via
cell.interior.colorindex does not work.

I was unable to get any code to recognize the conditionally formatted
cell. I finally resolved my problem by eliminating the conditional
formatting and hardcoding the conditionally formatted formulas into
the VBA module.

So, does anyone know of a method to get VBA to recognize a
conditionally formatted cell?

Art

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default recognizing conditional formatting with VBA

On Feb 10, 10:18*pm, "Rick Rothstein"
wrote:
You cannot "see" the formatting resulting being applied to a cell from
Conditional Formatting directly. The best you can do is have your code
perform the same test that the Conditional Formatting is doing... if your
test is True then so is the one the Conditional Formatting is evaluating, so
then you know it is applying whatever formatting to the cell that was
specified.

Rick Rothstein (MVP - Excel)


thanks - I had a suspicion the answer was going to be something along
the lines of your response...

Art

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 621
Default recognizing conditional formatting with VBA

See Chip's site.

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


Gord Dibben MS Excel MVP

On Thu, 10 Feb 2011 18:50:32 -0800 (PST), c1802362 wrote:

Hello group.

Came across a situation today which I couldn't resolve to my
satisfaction. Maybe someone here can help...

A colleague needed me to code a spreadsheet with a fairly simple
requirement. If a certain cell was green, the entire row would be
colored green; if the cell was red, the entire row would be shaded
red. The issue is the cell I'm basing everything off of is
conditionally formatted. Trying to recognize the cell's color via
cell.interior.colorindex does not work.

I was unable to get any code to recognize the conditionally formatted
cell. I finally resolved my problem by eliminating the conditional
formatting and hardcoding the conditionally formatted formulas into
the VBA module.

So, does anyone know of a method to get VBA to recognize a
conditionally formatted cell?

Art

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
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Protect Cell Formatting including Conditional Formatting Mick Jennings Excel Discussion (Misc queries) 5 November 13th 07 05:32 PM
Recognizing Cell Formatting To Use In A Formula Or Conditional For Jim J. Excel Worksheet Functions 0 September 20th 06 08:28 PM
Conditional Formatting Recognizing Greatest Value JR573PUTT Excel Discussion (Misc queries) 6 February 22nd 06 10:25 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM


All times are GMT +1. The time now is 11:59 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"