Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pie Chart Colors
I have a simple table with three columns
1. Title 2. Value 3. Color With data like B 8 Blue J 5 Yellow V 12 Green How can I using vba set the color for each pie chart segment based on the specified color from the respective data from the color column. So the slice representing B (8) would be blue and the J (5) would be yellow, etc. Thank you QB |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pie Chart Colors
Format your "color" cells with colours from the drop-down Fill color
palette. In the following change rngFirstClrCell = to suit Sub test() Dim n As Long Dim cht As Chart Dim pt As Point Dim rFirstClrCell As Range Set rFirstClrCell = Range("C3") ' << CHANGE Set cht = ActiveChart If cht Is Nothing Then MsgBox "Select a chart" Exit Sub End If For Each pt In cht.SeriesCollection(1).Points pt.Fill.ForeColor.SchemeColor = _ rFirstClrCell.Offset(n, 0).Interior.ColorIndex n = n + 1 Next End Sub Regards, Peter T "Question Boy" wrote in message ... I have a simple table with three columns 1. Title 2. Value 3. Color With data like B 8 Blue J 5 Yellow V 12 Green How can I using vba set the color for each pie chart segment based on the specified color from the respective data from the color column. So the slice representing B (8) would be blue and the J (5) would be yellow, etc. Thank you QB |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Chart Colors | Charts and Charting in Excel | |||
Bar Chart colors less than zero | Excel Discussion (Misc queries) | |||
How can I show different bar colors in the same chart? | Charts and Charting in Excel | |||
static colors in chart chart | Charts and Charting in Excel | |||
chart default colors | Charts and Charting in Excel |