Results 1 to 2 of 2
Thread: Auto change fill color
2009-08-31, 15:27 #1
- Join Date
- Feb 2006
- Thanked 0 Times in 0 Posts
How can I apply the codes to auto change file color in a excel worksheet? I have a field call "Target", and the valume is 100%. I also have 12 fields which are "Jan" to "Dec." I would like to have file color of those 12 fields to be changed based on the valume in those fields. For example, if the value in "Jan" is 90%, then the fill color of "Jan" will be Red. If the value in "Feb" is 80%, then the fill color of "Feb" will be Green.
Thanks in advance.
2009-08-31, 15:43 #2
- Join Date
- Mar 2002
- Thanked 29 Times in 29 Posts
If you're using Excel 2003 or earlier:
If you want to apply at most 3 different colors depending on the value (apart from the default formatting), you can use Format | Conditional Formatting - see for example Excel Conditional Formatting Tutorial & Screencast.
If you need more colors, you'd need to use VBA code in the Worksheet_Change event.
If you're using Excel 2007 or later:
Conditional formatting supports lots of different conditions. See for example Excel 2007 Tutorials - Conditional Formatting.