Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default color a range of cells based on a criteria

Hi,

I don't believe the conditional formatting tool gives me a solution to this
problem, so I probably need VBA.

Range B2:M2 contains the months January through December. January is in B2
and December is in M2.

In the range B1:M1, "business as usual starts" will either appear or not.
If it appears, its location will vary across that range.

I'm looking for VBA that will do the following:

1) If "business as usual" is in C1, the range B3:B14 will be highlighted
yellow, and the range C3:M14 will be highlighted green (remember, "business
as usual" will not necessarily be in C1, but can vary across the range
specified above)

2) If "business as usual" does not appear in the range B1:M1, then the range
B3:M14 will be highlighted yellow.

Clear?

I hope so.

Thanks in advance.

Dave
--
Brevity is the soul of wit.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default color a range of cells based on a criteria

C F should do that

Select B3:B14 and use a formula of

=$C$1="Business as usual"

for red, < for yellow

and

=ISNUMBER(MATCH("Business as usual"),$B$1:$M$1,0)

for the secondary yellow

You will need to determine priority.



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dave F" wrote in message
...
Hi,

I don't believe the conditional formatting tool gives me a solution to

this
problem, so I probably need VBA.

Range B2:M2 contains the months January through December. January is in

B2
and December is in M2.

In the range B1:M1, "business as usual starts" will either appear or not.
If it appears, its location will vary across that range.

I'm looking for VBA that will do the following:

1) If "business as usual" is in C1, the range B3:B14 will be highlighted
yellow, and the range C3:M14 will be highlighted green (remember,

"business
as usual" will not necessarily be in C1, but can vary across the range
specified above)

2) If "business as usual" does not appear in the range B1:M1, then the

range
B3:M14 will be highlighted yellow.

Clear?

I hope so.

Thanks in advance.

Dave
--
Brevity is the soul of wit.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,574
Default color a range of cells based on a criteria

Interesting suggestion. I'll try it, thanks.
--
Brevity is the soul of wit.


"Bob Phillips" wrote:

C F should do that

Select B3:B14 and use a formula of

=$C$1="Business as usual"

for red, < for yellow

and

=ISNUMBER(MATCH("Business as usual"),$B$1:$M$1,0)

for the secondary yellow

You will need to determine priority.



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dave F" wrote in message
...
Hi,

I don't believe the conditional formatting tool gives me a solution to

this
problem, so I probably need VBA.

Range B2:M2 contains the months January through December. January is in

B2
and December is in M2.

In the range B1:M1, "business as usual starts" will either appear or not.
If it appears, its location will vary across that range.

I'm looking for VBA that will do the following:

1) If "business as usual" is in C1, the range B3:B14 will be highlighted
yellow, and the range C3:M14 will be highlighted green (remember,

"business
as usual" will not necessarily be in C1, but can vary across the range
specified above)

2) If "business as usual" does not appear in the range B1:M1, then the

range
B3:M14 will be highlighted yellow.

Clear?

I hope so.

Thanks in advance.

Dave
--
Brevity is the soul of wit.




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
evaluate two cells and calculate based on criteria galiant Excel Worksheet Functions 6 July 10th 06 04:21 PM
sum number of cells based on letter/title criteria chazmac Excel Worksheet Functions 2 November 28th 05 05:09 PM
MIN within range based on criteria StevenL Excel Discussion (Misc queries) 9 July 11th 05 11:33 PM
counting cells (COUNTIF) based on two or more criteria Tricia S. Excel Worksheet Functions 10 March 17th 05 02:17 PM
Adding colour to a range of cells based on one of the cells v... McKenna Excel Discussion (Misc queries) 4 March 11th 05 02:25 PM


All times are GMT +1. The time now is 02:48 AM.

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"