Class IconSet (Excel VBA)
The class IconSet represents a single set of icons that are used in an icon set conditional formatting rule. To use a IconSet class variable it first needs to be instantiated, for example
Dim icnset as IconSet
Set icnset = ActiveWorkbook.IconSets(Index:=1)
For Each
Here is an example of processing the IconSet items in a collection.
Dim icnset As IconSet
For Each icnset In ActiveWorkbook.IconSets
Next icnset
Count
Returns a Long value that specifies the number of icons in the icon set.
Dim lngCount As Long
lngCount = ActiveWorkbook.IconSets(1).Count
ID
Returns one of the constants of the XlIconSet enumeration, which specifies the name of the icon set used in an icon set conditional formatting rule. Here you can find possible values for
Dim xisID As XlIconSet
xisID = ActiveWorkbook.IconSets(1).ID
Item
Returns an Icon object that represents a single icon from an icon set.
The value of the Index parameter cannot be greater than the number of icons in an icon set. To find the total number of icons in an icon set, use the Count property.
Item (Index)
Index: The index number of the Icon object.
Dim icnItem As Icon
Set icnItem = ActiveWorkbook.IconSets(1)(Index:=1)