Conditional Formatting

J

Jelinek

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
 
C

carno

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

tonywig

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.
 
Top