ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Conditional Formatting (https://www.excelbanter.com/excel-discussion-misc-queries/83912-conditional-formatting.html)

Jelinek

Conditional Formatting
 
I am using the Conditional Formatting facility however it only allows up to 3
contidions, i currently have five contdions i would like to work with how can
i implement this?

Thanks

Simon

carno

Conditional Formatting
 

Tell the actual problem,since we only put three conditions. Need to use
some trick to solve the purpose within three conditions.


--
carno
------------------------------------------------------------------------
carno's Profile: http://www.excelforum.com/member.php...o&userid=33633
View this thread: http://www.excelforum.com/showthread...hreadid=534064


Jelinek

Conditional Formatting
 
The problem is
I have five conditions

Failed
File Failure
Active
Successful
Queued

I would like to assign a colour code to the cells when they equal one of the
five conditions the way conditional formatting is set up i only allows three
contditions?

is there anything that can be done to add another contdition

Thanks

"carno" wrote:


Tell the actual problem,since we only put three conditions. Need to use
some trick to solve the purpose within three conditions.


--
carno
------------------------------------------------------------------------
carno's Profile: http://www.excelforum.com/member.php...o&userid=33633
View this thread: http://www.excelforum.com/showthread...hreadid=534064



tonywig

Conditional Formatting
 

I'm no expert. This works but someone more experienced may be able to
offer a simpler solution.

You cannot use conditional formatting to solve this.

Create a worksheet "SelectionChange" macro.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Text = "Failed" Then
With Selection.Interior
.ColorIndex = 6
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
If Selection.Text = "File Failure" Then
With Selection.Interior
.ColorIndex = 7
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
If Selection.Text = "Active" Then
With Selection.Interior
.ColorIndex = 3
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
If Selection.Text = "Successful" Then
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
If Selection.Text = "Queued" Then
With Selection.Interior
.ColorIndex = 5
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
End If
End Sub

Obviously you can shange the "ColorIndex" to meet your colour
requirements.
I've tried this and it works OK but might be a bit sluggish if the
worksheet is large.


--
tonywig


------------------------------------------------------------------------
tonywig's Profile: http://www.excelforum.com/member.php...o&userid=18985
View this thread: http://www.excelforum.com/showthread...hreadid=534064



All times are GMT +1. The time now is 12:27 PM.

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