• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Icon Set Colors?

Hesham911

New Member
Hi Guru's,

Just wondering if it's possible to change the icon set colors (Excel 2010) in the conditional formation via a VBA please? I know there is a workaround to change the colors via creating a custom table with colored symbols and a smart Lookup's.

Any guidance is really much appreciated.

Thanks in advanced
H
 

Thanks Vletm for the prompt response. I am using the above method in my spreadsheet already.

I'm just wondering if any solution was introduced via VBA.

I have tried this code, which works fine except the .Color = 7039480?

Code:
Sub ApplyIconSetCF()
  Dim rRangeToFormat As Range
  Dim ic As IconCriteria
 
  '--modify to the desired range
  Set rRangeToFormat = Range("C3:D15")
 
  With rRangeToFormat
      'With .FormatConditions
      '--clear any existing CF
        .Delete
        .AddIconSetCondition
        '.Color = 7039480
      End With
      With .FormatConditions(1)
        .SetFirstPriority
        .ReverseOrder = False
        .ShowIconOnly = False
        .IconSet = ActiveWorkbook.IconSets(xl3TrafficLights1)
        '.Color = 7039480
        With .IconCriteria(2)
            .Type = xlConditionValueNumber
            .Value = 40
            .Operator = xlGreaterEqual
            '.Color = 7039480
        End With
        With .IconCriteria(3)
            .Type = xlConditionValueNumber
            .Value = 70
            .Operator = xlGreaterEqual
        End With
      End With
  End With
End Sub

Many thanks,
H
 
http://chandoo.org/forum/members/vletm.19418/

I have tried to test as much as I can, some returned with out of range. but still can't change the color.
2rfegrs.png

thanks for your help Vletm, I tried my best.
 
Back
Top