Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
C C is offline
external usenet poster
 
Posts: 61
Default Color fill based on multiple conditions

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 563
Default Color fill based on multiple conditions

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" wrote in message
...
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
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
Need help to change a cell color based on conditions Ken Excel Worksheet Functions 1 January 28th 10 09:29 AM
How to set color for text based on conditions? Eric Excel Discussion (Misc queries) 2 October 12th 08 05:34 PM
Auto Fill Color of a particular Cell if conditions are put Akash Excel Programming 8 January 4th 07 12:55 PM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM
color formatting based on 12 conditions scire[_2_] Excel Programming 1 May 15th 04 10:50 AM


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