If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Conditional Pie Chart Formatting (Color)
I don't think KB noticed you were working with a Pie chart.
Here's the kind of macro you need. The X values of the plotted series is the column of division names, and the Y values are the pie wedge sizes. In the code below, change the dummy labels "AAAA" etc to your division labels, and change the ColorIndex values to the colors you want. Sub ColorWedges() Dim iPoint As Long, nPoint As Long With ActiveChart.SeriesCollection(1) For iPoint = 1 To .Points.Count Select Case WorksheetFunction.Index(.XValues, iPoint) Case "AAAA" .Points(iPoint).Interior.ColorIndex = 6 ' Yellow Case "BBBB" .Points(iPoint).Interior.ColorIndex = 5 ' Blue Case "CCCC" .Points(iPoint).Interior.ColorIndex = 3 ' Red Case "DDDD" .Points(iPoint).Interior.ColorIndex = 13 ' Purple Case "EEEE" .Points(iPoint).Interior.ColorIndex = 46 ' Orange Case "FFFF" .Points(iPoint).Interior.ColorIndex = 4 ' Green Case "GGGG" .Points(iPoint).Interior.ColorIndex = 8 ' Cyan End Select Next End With End Sub - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services http://PeltierTech.com/Excel/Charts/ _______ Tim Gardner wrote: Thanks KBBrown. However, I'm still not getting it. I separated the data into 4 columns and then made each of the 4 a series within 1 pie chart. I was thinking that I could then individually highlight each of the 4 series and manually change the slice fill color. However, the pie chart seems only to display the first listed series. Maybe I misunderstood your advice? |
#2
|
|||
|
|||
Conditional Pie Chart Formatting (Color)
Jon, thanks for the advice. However, I've never used macros. Might you have any reference suggestions?
|
#3
|
|||
|
|||
Conditional Pie Chart Formatting (Color)
Tim -
David McRitchie has an introduction: http://www.mvps.org/dmcritchie/excel/getstarted.htm and there are a few Microsoft pages: http://support.microsoft.com/support...01/default.asp http://msdn.microsoft.com/library/en...mmersguide.asp http://www.microsoft.com/officedev/a.../toc/pgtoc.htm - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services http://PeltierTech.com/Excel/Charts/ _______ Tim Gardner wrote: Jon, thanks for the advice. However, I've never used macros. Might you have any reference suggestions? |
#4
|
|||
|
|||
Conditional Pie Chart Formatting (Color)
Thank you Jon.
|
Thread Tools | |
Display Modes | |
|
|