第1个回答 2011-05-03
可以用自定义函数解决:)稍等一下,我把函数写给你。
Private Function hehe(ByVal Aaa As Range) As String
If Aaa.Value < 5 Then
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLess, Formula1:="5"
Selection.FormatConditions(1).Interior.ColorIndex = 3
hehe = ""
Else
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlGreaterEqual, Formula1:="5"
Selection.FormatConditions(1).Interior.ColorIndex = 2
hehe = ""
End If
End Function