Conditional formatting with pictograms

SaskiaHe

New Member
Joined
Apr 14, 2009
Messages
20
Hello,

I'm using the code below to apply conditional formatting with pictograms to a range of cells.

Now I want to check a pictogram in a cell. Whether is has a green or a red arrow or something like that. How can I accomplish that?

Any help would be greatly apprecated.

Saskia

Code:
    Range("G8:K14").Select
    With Selection.FormatConditions(1).IconCriteria(2)
        .Type = xlConditionValuePercent
        .Value = 20
        .Operator = 7
    End With
    With Selection.FormatConditions(1).IconCriteria(3)
        .Type = xlConditionValuePercent
        .Value = 40
        .Operator = 7
    End With
    With Selection.FormatConditions(1).IconCriteria(4)
        .Type = xlConditionValuePercent
        .Value = 60
        .Operator = 7
    End With
    With Selection.FormatConditions(1).IconCriteria(5)
        .Type = xlConditionValuePercent
        .Value = 80
        .Operator = 7
    End With
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
My apologies, the code above is not correct. Below is the right one:

Code:
Range("G8:K14").Select
    Selection.FormatConditions.AddIconSetCondition
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1)
        .ReverseOrder = False
        .ShowIconOnly = False
        .IconSet = ActiveWorkbook.IconSets(xl5Arrows)
    End With
    With Selection.FormatConditions(1).IconCriteria(2)
        .Type = xlConditionValuePercent
        .Value = 20
        .Operator = 7
    End With
    With Selection.FormatConditions(1).IconCriteria(3)
        .Type = xlConditionValuePercent
        .Value = 40
        .Operator = 7
    End With
    With Selection.FormatConditions(1).IconCriteria(4)
        .Type = xlConditionValuePercent
        .Value = 60
        .Operator = 7
    End With
    With Selection.FormatConditions(1).IconCriteria(5)
        .Type = xlConditionValuePercent
        .Value = 80
        .Operator = 7
    End With
 
Upvote 0
if nobody can answer this question, can anybody tell me how the values are divided into the 5 groups?
I understand it roughly, but don't seem to be able to reproduce exactly.

Thanks in advance.
 
Last edited:
Upvote 0
Does nobody understand how conditional formatting with icons work?

I'm trying to classify data into 5 categories and to determine in VBA to which category a value in a cell belongs.
As nobody answers, this either seems to be a very stupid question or Excel makes it so difficult that nodbody understands ...

If anybody understands though, please, please help me.
 
Upvote 0

Forum statistics

Threads
1,215,493
Messages
6,125,134
Members
449,206
Latest member
burgsrus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top