The code segment from "Get Around Excels 3 Criteria Limit in Conditional Formatting" works perfectly if I type the variable directly into the cell, but not in a range of cells.
That is to say, if I copy the source cell to a range of cells I receive a "Run-time error 13: Type mismatch" error".
Is there a way to get around this?
This is the code segment I've tried in the worksheet.
Code
Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer
If Not Intersect(Target, Range("b2:q53")) Is Nothing Then
Select Case Target
Case "IBBCH", "ibbch"
icolor = 36 'light yellow
Case "OBBCH", "obbch"
icolor = 34 'light turqoise
Case "OBBRDG", "obbrdg"
icolor = 35 'light green
Case "LNCH", "lnch"
icolor = 53 'brown
Case "BRK", "brk"
icolor = 15 'gray-25%
Case "AV", "av"
icolor = 10 'green
Case "AS", "as", "med", "MED"
icolor = 3 'red
Case Else
'Whatever
End Select
Target.Interior.ColorIndex = icolor
End If
End Sub
Display More