Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
customizing chart column color formats in code
I have some code that examines a set of data and generates a
x1columncluster chart. Depending on the set of data, I may have any number of column clusters as a result. However, I currently format the columns manually to make certain groupings a given color and another group of columns a different color and so forth. I would like to automate this. Is there a way to go through each column like for x = 1 to numberOfColumns check group If group = 1 set color accordingly else set color differently end if Did that make sense? TIA |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
customizing chart column color formats in code
I don't know exactly how you are setting up or checking your groups, but to
specify the color of a column (i.e. series) in a chart, the following line of code specifies the complete reference to the color property of the chart series - the () need either the index number or name of the corresponding object: ThisWorkbook.Sheets().ChartObjects().Chart().Serie sCollection().Interior.Color To step through them (in a particular chart) you can do a For Each loop: Dim ThisSeries as Series For Each ThisSeries in ThisWorkbook.Sheets().ChartObjects().Chart().Serie sCollection ThisSeries.Interior.Color = ' set color here, based on your criteria Next ThisSeries This will color an entire series; if you need to color individual points within that series it would be ThisWorkbook.Sheets().ChartObjects().Chart().Serie sCollection().Points().Interior.Color And you could step through them with a For Each again, but this time stepping through the points instead of the series. HTH K Dales "Papa Jonah" wrote: I have some code that examines a set of data and generates a x1columncluster chart. Depending on the set of data, I may have any number of column clusters as a result. However, I currently format the columns manually to make certain groupings a given color and another group of columns a different color and so forth. I would like to automate this. Is there a way to go through each column like for x = 1 to numberOfColumns check group If group = 1 set color accordingly else set color differently end if Did that make sense? TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Customizing Color Palette in Excel 2007 | Excel Discussion (Misc queries) | |||
customizing text color | New Users to Excel | |||
Change column color in chart when column value is over/under goal | Charts and Charting in Excel | |||
Copy Color Formats Based On Column Date Values | Excel Discussion (Misc queries) | |||
customizing chart column color formats in code | Excel Programming |