Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49948

Help with Format if no formula

$
0
0
hello,
I have the following code and it works well, but if I apply a conditional format to any of the cells in the range, the code does not work because the conditional format takes over.
Is there a way for the code to take priority over any conditional format available in Excel?

Thank you :)

Code:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
For Each cl In Range("$A17:$I1500")
If Not cl.HasFormula And cl <> "" Then
    cl.Interior.ColorIndex = 5
End If
Next cl
End Sub


Viewing all articles
Browse latest Browse all 49948

Trending Articles