• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 647
  • Last Modified:

How do I get the HEX or RGB numbers for the colours used in Excel Chart Style 2

Hi,

I wish to get the HEX or RBG numbers for the colours that are used in the Excel 2007's chart style 2.

This is the chart style as shown in the sample sheet below.  I have used the macro recorder but that just applies activechart.chartstyle = 2

I am really only interested in the colour of the different data series shown on the example.  Green, Blue, Purple and Red etc.

Thanks
ColourStyle.xlsx
0
wobbled
Asked:
wobbled
  • 2
  • 2
1 Solution
 
Rory ArchibaldCommented:
Do you actually need the individual R, G and B component values, or just the overall RGB number?
0
 
wobbledAuthor Commented:
The overall RBG should be fine

I'm trying to recreate charts in WPF using a similar style to that available in Excel so I can work with any colour codes that Microsoft accepts
0
 
Rory ArchibaldCommented:
OK - for example:
Sub GetRGB()
    Dim n As Long
    With ActiveChart.SeriesCollection
        For n = 1 To .Count
            Debug.Print .Item(n).Border.Color
        Next n
    End With
End Sub

Open in new window


this will output the values to the Immediate Window in the VBE. (you need to select the chart first)
0
 
kgerbChief EngineerCommented:
Whenever I need to get RGB values for something I use Pixie.  It works well.

Kyle
0
 
wobbledAuthor Commented:
Thanks - did the job fine
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now