✔ 最佳答案
格式化條件-圖示集,條件規則是以單一值比較或範圍內百分比比較,公式無法以相對儲存格輸入.
因版主所求比對值為相對儲存格,所以解決辦法僅能每一個儲存格逐一輸入.
如下圖
圖片參考:
https://s.yimg.com/rk/AF02823975/o/458577613.jpg
或者可以巨集方式,將範圍內儲存格逐一設定格式化條件.
以下僅供參考
Sub TEST2()
Dim Rng As Range
For Each Rng In Selection
rng2 = Rng.Offset(0, -1).Address
Rng.FormatConditions.AddIconSetCondition.SetFirstPriority
With Rng.FormatConditions(1)
.IconSet = ActiveWorkbook.IconSets(xl3Arrows)
.IconCriteria(2).Type = xlConditionValueNumber
.IconCriteria(2).Value = "=" & rng2
.IconCriteria(2).Operator = 7
.IconCriteria(3).Type = xlConditionValueNumber
.IconCriteria(3).Value = "=" & rng2
.IconCriteria(3).Operator = 5
End With
Next
End Sub
請參考~
https://www.dropbox.com/s/on19mc0qua8nz0h/test3.xlsb?dl=0