I am writing a code which should mark in a range, in red, all cells which do not include the words "bel"
and "hsa"
.
Sub Check()
Range("c2:c49").Select
For Each cell In Selection
If (cell.Value <> "bel" Or cell.Value <> "hsa") Then
cell.Interior.Color = RGB(255, 0, 0)
End If
Next cell
End Sub
It works if I only have one argument. With the two arguments like above, it marks all cells in range red.
Is the Or
operator wrong?