【发布时间】:2021-07-24 13:26:04
【问题描述】:
Sub InsertingIcons()
'
' What's wrong with macro. I want macro to run from Cell F12 to H 12 and change to conditional fomatting
'
'for loop
Dim x As Variant
For x = 7 To 11
Selection.FormatConditions.AddIconSetCondition
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1)
.ReverseOrder = False
.ShowIconOnly = False
.IconSet = ActiveWorkbook.IconSets(xl3Arrows)
End With
With Selection.FormatConditions(1).IconCriteria(2)
.Type = xlConditionValueNumber
.Value = "='DETAILED BS'!" & R12 & x
.Operator = 7
End With
With Selection.FormatConditions(1).IconCriteria(3)
.Type = xlConditionValueNumber
.Value = "='DETAILED BS'!" & R12 & x
.Operator = 5
End With
Next x
End
End Sub
【问题讨论】: