As stated in the Excel Help topic, "Apply
conditional formats to cells", "...You can
specify up to three conditions."
But is it possible, through another means such as VB or something else, to get around this limitation?
> But is it possible, through another means such
as VB or something else, to get around this limitation?
Theoretically, one could mimic conditional formatting
using VBA.
Hi Jamie
This is possible, but you will need some VBA within the Sheet module like below:
'START OF CODE
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim WatchRange As Range
Dim CellVal As Integer
If Target.Cells.Count > 1 Then Exit Sub
If Target = "" Or Not IsNumeric(Target) Then Exit Sub
CellVal = Target
Set WatchRange = Range("A1:A10")
If Not Intersect(Target, WatchRange) Is Nothing Then
Select Case CellVal
Case 0 To 10
Target.Interior.ColorIndex = 5
Case 10 To 20
Target.Interior.ColorIndex = 10
Case 21 To 30
Target.Interior.ColorIndex = 6
Case 31 To 40
Target.Interior.ColorIndex = 46
Case 41 To 50
Target.Interior.ColorIndex = 45
End Select
End If
End Sub
'END OF CODE
You can add more conditions to this if needed.
It will only apply to the range A1:A10 (Change if needed)
The easiest way to obtain the Color Index numbers is to Record a Macro.
To put this code in:
Right click on the sheet Name tab and select "View Code" then paste the code over the top of what you see.
Push Alt+Q to return to Excel and Save.
Dave
OzGrid Business Applications
Do you know how to do this? How do you mimic conditional formatting in VBA?
Jamie, read my first post!
Dave
OzGrid Business Applications