Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
Hi guys,
I have a bar chart that has 3 bars in a chart. I am using a 2D Clustered Column. I need for each bar to have a seperate color. Name FSR QC CQA Leola 2 8 0 The color for the three? Using Late Binding, as I can't use Early Binding since others are using different versions of Excel (2002 and 2003). Select Case .ActiveCell.Value Case "QC" .Sheets("Chart1").Select .ActiveChart.SeriesCollection(x).Select .Selection.Interior.ColorIndex = 19 Case "FSR" .Sheets("Chart1").Select .ActiveChart.SeriesCollection(x).Select .Selection.Interior.ColorIndex = 18 Case "CQA" .Sheets("Chart1").Select .ActiveChart.SeriesCollection(x).Select .Selection.Interior.ColorIndex = 17 Case Else 'Do nothing End Select Is this possible? |
#2
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
If you want to color points (bars) based on the category, try this sub:
Sub ColorPoints() 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 If instead you ate coloring based on series name, try this:Sub ColorSeries() With ActiveChart.SeriesCollection(1) Select Case .Name Case "AAAA" .Interior.ColorIndex = 6 ' Yellow Case "BBBB" .Interior.ColorIndex = 5 ' Blue Case "CCCC" .Interior.ColorIndex = 3 ' Red Case "DDDD" .Interior.ColorIndex = 13 ' Purple Case "EEEE" .Interior.ColorIndex = 46 ' Orange Case "FFFF" .Interior.ColorIndex = 4 ' Green Case "GGGG" .Interior.ColorIndex = 8 ' Cyan End Select End With End Sub - Jon-------Jon Peltier, Microsoft Excel MVPTutorials and Custom SolutionsPeltier Technical Services, Inc. - http://PeltierTech.com_______"EAB1977" wrote in message ps.com... Hi guys, I have a bar chart that has 3 bars in a chart. I am using a 2D Clustered Column. I need for each bar to have a seperate color. Name FSR QC CQA Leola 2 8 0 The color for the three? Using Late Binding, as I can't use Early Binding since others are using different versions of Excel (2002 and 2003). Select Case .ActiveCell.Value Case "QC" .Sheets("Chart1").Select .ActiveChart.SeriesCollection(x).Select .Selection.Interior.ColorIndex = 19 Case "FSR" .Sheets("Chart1").Select .ActiveChart.SeriesCollection(x).Select .Selection.Interior.ColorIndex = 18 Case "CQA" .Sheets("Chart1").Select .ActiveChart.SeriesCollection(x).Select .Selection.Interior.ColorIndex = 17 Case Else 'Do nothing End Select Is this possible? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
changing colors of slices in a pie chart | Charts and Charting in Excel | |||
changing colors | Excel Discussion (Misc queries) | |||
pivot chart colors- how to keep from changing when data elements are added/removed? | Charts and Charting in Excel | |||
HOW TO CREATE A BUBBLE CHART WITH CHANGING COLORS? | Charts and Charting in Excel | |||
How do i stop the colors changing on my pivot chart when i refres. | Excel Discussion (Misc queries) |