try:
Sub Relative2()
With Selection.Resize(, 20)
LowerCellAddress = .Cells(1).Address(False, False)
UpperCellAddress = .Cells(1).Offset(-1).Address(False, False)
.FormatConditions.Delete
With .FormatConditions.Add(Type:=xlExpression, Formula1:="=AND(" & UpperCellAddress & ">0," & LowerCellAddress & "=0)")
.SetFirstPriority
With .Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
End With
.StopIfTrue = False
End With
End With
End Sub
Since posting, it's easier than that; change your:
Selection.FormatConditions.Add Type:=xlExpression, FormulaR1C1:="=AND(R[-1]C[0]>0,R[0]C[0]=0)"
to:
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=AND(R[-1]C[0]>0,R[0]C[0]=0)"
so simplified a bit:
Sub Relative3()
With Selection.Resize(, 20).FormatConditions
.Delete
With .Add(Type:=xlExpression, Formula1:="=AND(R[-1]C[0]>0,R[0]C[0]=0)")
.SetFirstPriority
With .Interior
.PatternColorIndex = xlAutomatic
.Color = 65535
.TintAndShade = 0
End With
.StopIfTrue = False
End With
End With
End Sub