(Solved) – Conditional Formatting VBA identify icon

(solved)-–-conditional-formatting-vba-identify-icon

A cell is conditionally formatted to have one of 3 icons depending on the value in the cell. I want to make a function in VBA, that returns the icon value/number/identifier (something to identify the icon) from that cell. So essentially like the following:

Function GetColor(r As Range) As Integer
GetColor = r.Interior.ColorIndex
End Function
but instead of getting the Color I want to get the Icon.

Edit: So to do the conditional formating say cell A1 has value 3 and I use the “ICON SET” under conditional formatting to take a green arrow (up) if the value is greater than 1, a yellow arrow if the value is between -1 and 1, and a red arrow if the value is less than -1. I want to create a function that would return a value identifying the green arrow for the case of A1.

Leave a Reply

Your email address will not be published. Required fields are marked *