A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Conditional Pie Chart Formatting (Color)



 
 
Thread Tools Display Modes
  #1  
Old March 8th, 2004, 11:02 PM
Jon Peltier
external usenet poster
 
Posts: n/a
Default 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  
Old March 9th, 2004, 01:51 PM
Tim Gardner
external usenet poster
 
Posts: n/a
Default Conditional Pie Chart Formatting (Color)

Jon, thanks for the advice. However, I've never used macros. Might you have any reference suggestions?
  #3  
Old March 9th, 2004, 02:59 PM
Jon Peltier
external usenet poster
 
Posts: n/a
Default 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  
Old March 9th, 2004, 10:31 PM
Tim Gardner
external usenet poster
 
Posts: n/a
Default Conditional Pie Chart Formatting (Color)

Thank you Jon.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:06 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.