Good day!
I am trying to set up conditional formatting on a range using icon sets.
This should be achievable using the following steps:
- Obtain a reference to the FormatConditions property of the Range object
- Invoke the AddIconSetCondition method on the property to obtain a reference to an IconSetCondition
- Set the IconSet property of the IconSetCondition object to an IconSet of your choosing
- Obtain a reference to the IconSetCriteria collection of the IconSetCondition object
- For each member of the IconSetCriteria collection set the values of the following properties as desired: Operator, Type, Value (you may also set Icon)
I am able to set the value of the Operator property, but when setting the values of either the Type or Value properties I get a 1004 Run-time error.
It is somewhat frustrating because this should be possible according to the example on Microsoft Learn. I have even copied the example on Microsoft Learn into my module and attempted to run it - it also does not work with the same error.
Here is the link to the example:
Would anyone be able to offer a solution?
P.S. Sorry, I've been disallowed from posting the link - just google learn.microsoft.com VBA IconCriterion for the example.
Bookmarks