A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help with more than three conditions when formating.



 
 
Thread Tools Display Modes
  #1  
Old May 15th, 2004, 03:15 AM
SMonczka
external usenet poster
 
Posts: n/a
Default Help with more than three conditions when formating.

Is it possible to have more than three conditions using conditional
formatting? I have a list of five products in a column. I want to
use a different color cell for each product. Product 1 would be
yellow, product 2 would be blue, product 3 would be green. I know how
to use conditional formatting to format each but I only seem to be
able to set up three conditions.
  #2  
Old May 15th, 2004, 04:02 AM
David McRitchie
external usenet poster
 
Posts: n/a
Default Help with more than three conditions when formating.

When you can't use Conditional Formatting (more than 3 formats),
the next step is to use an Event Macro. See
http://www.mvps.org/dmcritchie/excel/event.htm#case
look at top for instructions to install, right click on sheet tab,
view code, then place your code in the sheet module.
---
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

"SMonczka" wrote in message om...
Is it possible to have more than three conditions using conditional
formatting? I have a list of five products in a column. I want to
use a different color cell for each product. Product 1 would be
yellow, product 2 would be blue, product 3 would be green. I know how
to use conditional formatting to format each but I only seem to be
able to set up three conditions.



  #3  
Old May 15th, 2004, 10:01 AM
Frank Kabel
external usenet poster
 
Posts: n/a
Default Help with more than three conditions when formating.

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


--
Regards
Frank Kabel
Frankfurt, Germany

"SMonczka" schrieb im Newsbeitrag
om...
Is it possible to have more than three conditions using conditional
formatting? I have a list of five products in a column. I want to
use a different color cell for each product. Product 1 would be
yellow, product 2 would be blue, product 3 would be green. I know

how
to use conditional formatting to format each but I only seem to be
able to set up three conditions.


 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.