Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need help to change a cell color based on conditions | Excel Worksheet Functions | |||
How to set color for text based on conditions? | Excel Discussion (Misc queries) | |||
Auto Fill Color of a particular Cell if conditions are put | Excel Programming | |||
change fill color of a range of cells based on color of a cell? | Excel Programming | |||
color formatting based on 12 conditions | Excel Programming |