L
L. Howard
The values in Range("C112") will hand entered as 1, 2, 3 or 4 only. Cells can be blank.
When I run the code the range is nicely CF'ed to;
1 = Red Diamond
2 = Yellow triangle
3 = Green circle
4 = Green Circle
Blank = 'no icon'
The problem is I want the 4 to = the icon green check MARK not a green CIRCLE. However, the green check mark is part of the xl3Symbol icon set.
I would be happy with a Blue Star if I could make that happen, as long as it shows in the cell like the xl3Signs do.
Anyone have a suggestion?
Thanks.
Howard
Option Explicit
Sub CreateIconSetCF()
Dim cfIconSet As IconSetCondition
Range("C112").Select
On Error Resume Next
Set cfIconSet = Selection.FormatConditions.AddIconSetCondition
cfIconSet.IconSet = ActiveWorkbook.IconSets(xl3Signs)
With cfIconSet.IconCriteria(1)
.Type = xlConditionValueNumber
.Value = 1
.Operator = 3
End With
With cfIconSet.IconCriteria(2)
.Type = xlConditionValueNumber
.Value = 2
.Operator = 3
End With
With cfIconSet.IconCriteria(3)
.Type = xlConditionValueNumber
.Value = 3
.Operator = 3
End With
With cfIconSet.IconCriteria(4)
.Type = xlConditionValueNumber
.Value = 4
.Operator = 4
End With
End Sub
When I run the code the range is nicely CF'ed to;
1 = Red Diamond
2 = Yellow triangle
3 = Green circle
4 = Green Circle
Blank = 'no icon'
The problem is I want the 4 to = the icon green check MARK not a green CIRCLE. However, the green check mark is part of the xl3Symbol icon set.
I would be happy with a Blue Star if I could make that happen, as long as it shows in the cell like the xl3Signs do.
Anyone have a suggestion?
Thanks.
Howard
Option Explicit
Sub CreateIconSetCF()
Dim cfIconSet As IconSetCondition
Range("C112").Select
On Error Resume Next
Set cfIconSet = Selection.FormatConditions.AddIconSetCondition
cfIconSet.IconSet = ActiveWorkbook.IconSets(xl3Signs)
With cfIconSet.IconCriteria(1)
.Type = xlConditionValueNumber
.Value = 1
.Operator = 3
End With
With cfIconSet.IconCriteria(2)
.Type = xlConditionValueNumber
.Value = 2
.Operator = 3
End With
With cfIconSet.IconCriteria(3)
.Type = xlConditionValueNumber
.Value = 3
.Operator = 3
End With
With cfIconSet.IconCriteria(4)
.Type = xlConditionValueNumber
.Value = 4
.Operator = 4
End With
End Sub