Class Icon (Excel VBA)

The class Icon represents a single icon in an icon set used in a conditional formatting rule. To use a Icon class variable it first needs to be instantiated, for example


Dim icn as Icon
Set icn = ActiveWorkbook.IconSets(1)(Index:=1)

For Each

Here is an example of processing the Icon items in a collection.


Dim icnParent As Icon
For Each icnParent In ActiveWorkbook.IconSets.Parent
	
Next icnParent

Index

Returns a Long value specifying the index number of the Icon object within the IconSet object.


Dim lngIndex As Long
lngIndex = ActiveWorkbook.IconSets(1)(1).Index