Solved

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

Posted on 2012-03-26
5
611 Views
Last Modified: 2012-06-27
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
Comment
Question by:wobbled
  • 2
  • 2
5 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 37766619
Do you actually need the individual R, G and B component values, or just the overall RGB number?
0
 
LVL 17

Author Comment

by:wobbled
ID: 37766672
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
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 37766723
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
 
LVL 12

Expert Comment

by:kgerb
ID: 37766729
Whenever I need to get RGB values for something I use Pixie.  It works well.

Kyle
0
 
LVL 17

Author Closing Comment

by:wobbled
ID: 37766767
Thanks - did the job fine
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question