I'm trying the following conditional formatting to highlight cell A based on the value of cells B, C, D but it raises the error type mismatch.
Sub logic()
Dim i As Long
For i = 1 To 3
Range(Replace("A#", "#", i)).Select
Range("A" & i).Activate
Application.CutCopyMode = False
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=$B$" & i And "=$C$" & i Or "=$D$" & i
With Selection.FormatConditions(1).Interior
.Color = RGB(100, 100, 100)
End With
Selection.FormatConditions(1).StopIfTrue = False
Next i
End Sub