Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 866
Default More than 3 Conditions for formatting

I would like to be able to use conditional formatting for more than 3
conditions. Any suggestions?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default More than 3 Conditions for formatting


'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'-----------------------------------------------------------------
Const WS_RANGE As String = "H1:H10" '<=== change to suit

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
Select Case .Value
Case 1: .Interior.ColorIndex = 3 'red
Case 2: .Interior.ColorIndex = 6 'yellow
Case 3: .Interior.ColorIndex = 5 'blue
Case 4: .Interior.ColorIndex = 10 'green
End Select
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Dan" wrote in message
...
I would like to be able to use conditional formatting for more than 3
conditions. Any suggestions?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 46
Default More than 3 Conditions for formatting

Sometimes you can by using AND() and OR() operators if your conditions
are not mutually exclusive- basically combining two or more conditions
into one. Please post your desired conditions.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 173
Default More than 3 Conditions for formatting

I don't know if this will help but you actually get 4 formats (the 3 that you
define via conditions that you set with conditional formatting and then the
"default" format, i.e. the format of the cell if none of the conditions are
met).
Will

"Dan" wrote:

I would like to be able to use conditional formatting for more than 3
conditions. Any suggestions?

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.misc
dan dan is offline
external usenet poster
 
Posts: 866
Default More than 3 Conditions for formatting

Thank you to everyone!

"roadkill" wrote:

I don't know if this will help but you actually get 4 formats (the 3 that you
define via conditions that you set with conditional formatting and then the
"default" format, i.e. the format of the cell if none of the conditions are
met).
Will

"Dan" wrote:

I would like to be able to use conditional formatting for more than 3
conditions. Any suggestions?

Thanks

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 4 conditions for conditional formatting and there are only 3 pm Excel Worksheet Functions 2 January 4th 07 07:51 PM
Need 6 Conditions / Conditional Formatting Rothman Excel Worksheet Functions 4 March 14th 06 10:07 PM
More than 3 conditions for formatting nsv Excel Discussion (Misc queries) 3 March 8th 06 02:23 PM
I have more than 6 conditions when using conditional formatting? Magda Excel Worksheet Functions 3 March 1st 06 09:15 AM
More than 3 Conditional Formatting Conditions Beth H Excel Worksheet Functions 12 January 6th 06 07:35 PM


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