PC Review


Reply
Thread Tools Rate Thread

Color fill based on multiple conditions

 
 
C
Guest
Posts: n/a
 
      15th Mar 2010
My spreadsheet contains subtotals.

A B C D E F
Production Line 1 10 1 5 2 10
Production Line 1 10 1 5 2 10
Production Line 1 Total 20 2 10 4 20

Some months the spreadsheet contains 100 lines and some months it contains
200. Does someone have some code that would loop through all the data in the
sheet and for each subtotaled line (when A contains Total), go to the same
row for B:F and if value is
less than 5, fill with orange
between 6 and 15, fill with blue
greater than 15, fill with green

I am using Excel 2003.

Blue Angel
 
Reply With Quote
 
 
 
 
Bernard Liengme
Guest
Posts: n/a
 
      15th Mar 2010
In A2:A10 I entered some text; a few had the word "Total"
In B2:F10 I entered some numbers
I select B2:F10 and in the Conditional Formatting dialog used
Formula IS: =AND($A2="Total", B2<5)
Format fill orange
Note the $ on A2. Because I selected down to row 10, the conditional
formatting applies to those rows also (so row 5 is =AND($A5="Total", B5<5) )
In pre-Excel2007 you can have up to 3 conditions
For more on the topic go to
See http://www.contextures.com/xlCondFormat01.html

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"C" <(E-Mail Removed)> wrote in message
news:AC0A4956-B0FA-4829-9D21-(E-Mail Removed)...
> My spreadsheet contains subtotals.
>
> A B C D E F
> Production Line 1 10 1 5 2 10
> Production Line 1 10 1 5 2 10
> Production Line 1 Total 20 2 10 4 20
>
> Some months the spreadsheet contains 100 lines and some months it contains
> 200. Does someone have some code that would loop through all the data in
> the
> sheet and for each subtotaled line (when A contains Total), go to the same
> row for B:F and if value is
> less than 5, fill with orange
> between 6 and 15, fill with blue
> greater than 15, fill with green
>
> I am using Excel 2003.
>
> Blue Angel


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help to change a cell color based on conditions Ken Microsoft Excel Worksheet Functions 1 28th Jan 2010 09:29 AM
How to set color for text based on conditions? Eric Microsoft Excel Misc 2 12th Oct 2008 05:34 PM
Auto Fill Color of a particular Cell if conditions are put Akash Microsoft Excel Programming 8 4th Jan 2007 12:55 PM
change fill color of a range of cells based on color of a cell? =?Utf-8?B?RGFyTWVsTmVs?= Microsoft Excel Programming 0 2nd Mar 2006 06:35 PM
color formatting based on 12 conditions =?Utf-8?B?c2NpcmU=?= Microsoft Excel Programming 2 15th May 2004 02:19 PM


Features
 

Advertising
 

Newsgroups
 


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