Hi all….I am using Excel 2003 which only permits 3 conditional formattings….I am using worksheet change event code to do a number of additional cond formattings. The code is shown here (below)……in the 6th CASE (see red font below), I am looking for some way to say that if there is text & ^ (eg: Smith^) or a number & ^ (eg: 304^) it will color the interior gray (15) with black font (1)……it won’t allow me to use something like “*”&”^” or *&”^” etc etc………the code I am using is this (except, of course the ‘CASES’ are not numbered as 1,2,3,4 etc — I did that to make my explanation clearer). Any suggestions or ideas? Thanks
Private Sub Worksheet_Change(ByVal target As Range)
Dim lRow As Long
Dim sClosed As String
Dim oCell As Range
sClosed = “Closed”
On Error GoTo ErrHandler
If Not Intersect(target, Range(“A15:A29”)) Is Nothing Then
Range(“f14:bf275″).Replace What:=sClosed, Replacement:=””
For lRow = 14 To 275
If Cells(lRow, 4) = sClosed Then
Range(“f” & lRow & “:bf” & lRow).Value = sClosed
End If
Next
End If
If Not Intersect(target, Range(“f14:bf275”)) Is Nothing Then
For Each oCell In Intersect(target, Range(“f14:bf275”)).Cells
Select Case oCell
1 Case “Conf.”, “Educ. Leave”
oCell.Interior.ColorIndex = 5
oCell.Font.ColorIndex = 2
2 Case “Not working”
oCell.Interior.ColorIndex = 4
oCell.Font.ColorIndex = 1
3 Case “Vacation”, “Vacation-AM”, “Vacation-PM”
oCell.Interior.ColorIndex = 15
oCell.Font.ColorIndex = 1
4 Case “Canceled”
oCell.Interior.ColorIndex = 3
oCell.Font.ColorIndex = 2
5 Case “Study Week”
oCell.Interior.ColorIndex = 13
oCell.Font.ColorIndex = 2
6 Case ‘NUMBER/TEXT’&”^”, ‘NUMBER/TEXT’&”^”
oCell.Interior.ColorIndex = 15
oCell.Font.ColorIndex = 15
7 Case “Closed”
oCell.Interior.ColorIndex = 15
oCell.Font.ColorIndex = 1
8 Case “Duty officer”
oCell.Interior.ColorIndex = 1
oCell.Font.ColorIndex = 2
9 Case Else
oCell.Interior.ColorIndex = xlColorIndexAutomatic
oCell.Font.ColorIndex = 1
End Select
Next oCell
End If
ExitHandler:
Exit Sub
ErrHandler:
MsgBox Err.Number & Err.Description
Resume ExitHandler
End Sub