ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional Formatting - More than 3 conditions (https://www.excelbanter.com/excel-worksheet-functions/154623-conditional-formatting-more-than-3-conditions.html)

Madge

Conditional Formatting - More than 3 conditions
 
Do Microsoft have any plans to expand the number of conditions available. 3
is very limiting. Alternatively, are there any work-arounds for something as
simple as a rota for several different activities, all of which need colour
coding? Thanks.

Toppers

Conditional Formatting - More than 3 conditions
 
In Excel 2007 they number of conditions is increased ( I believe) but a "work
around" is the code below Or

see

http://www.xldynamic.com/source/xld....Download.html:

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


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
'etc.
End Select
End With
End If


ws_exit:
Application.EnableEvents = True
End Sub

Put this code in the w/sheet where you want the CFs. Right click on tab,
"View code" and copy/paste.

You will need to adjust the tests for your conditions as it currently tests
for values
1 to 4 (which can be extended).
"Madge" wrote:

Do Microsoft have any plans to expand the number of conditions available. 3
is very limiting. Alternatively, are there any work-arounds for something as
simple as a rota for several different activities, all of which need colour
coding? Thanks.


Madge

Conditional Formatting - More than 3 conditions
 


"Madge" wrote:

Do Microsoft have any plans to expand the number of conditions available. 3
is very limiting. Alternatively, are there any work-arounds for something as
simple as a rota for several different activities, all of which need colour
coding? Thanks.


Thanks. Looks like I need to update my version of Excel then!!


All times are GMT +1. The time now is 03:36 PM.

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