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
619 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

738 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