ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Conditional Formatting - more than 3? (https://www.excelbanter.com/excel-programming/304518-conditional-formatting-more-than-3-a.html)

Mickey Authement

Conditional Formatting - more than 3?
 
If there a way to get more than 3 conditions for conditional formatting?
Using Excel 2002 SP3.



Frank Kabel

Conditional Formatting - more than 3?
 
Hi
conditional format only accepts 3 conditions though you
have a fourth
if you include the default format.

If you only want to apply different FONT colors based on
NUMBERS, you
can define up to 6 different styles. See:
http://www.mcgimpsey.com/excel/conditional6.html
for instructions how to do it

For everything else you'll need VBA code (e.g. process the
worksheet_change event and apply your format based on the
cell values).
The following will color the entry in cell A1:A100 based
on its value:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Then Exit Sub
If Intersect(Target, Me.Range("A1:A100")) Is Nothing
Then Exit Sub
On Error GoTo CleanUp
Application.EnableEvents = False
With Target
Select Case .Value
Case "Red": .Interior.ColorIndex = 3
Case "Blue": .Interior.ColorIndex = 10
'etc.
End Select
End With
CleanUp:
Application.EnableEvents = True
End Sub


-----Original Message-----
If there a way to get more than 3 conditions for

conditional formatting?
Using Excel 2002 SP3.


.


whisperer[_8_]

Conditional Formatting - more than 3?
 
Removed as it is covered adequately abov

--
Message posted from http://www.ExcelForum.com


david mcritchie

Conditional Formatting - more than 3?
 
You are posting to the programming newsgroup which has nothing to do
with ExcelForum -- what do you mean by removed. The complete thread
as seen in the Google Groups archive (12 hour delay) is ...

http://google.com/groups?threadm=10f....supernews.com

Since I have posted to this thread might as well add my own link
http://www.mvps.org/dmcritchie/excel/event.htm#case
as the normal solution when you need more than 3 conditional formats.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"whisperer " wrote in message ...
Removed as it is covered adequately above


---
Message posted from http://www.ExcelForum.com/





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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com