Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 148
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Customizing Color Palette in Excel 2007 Frustrated with Office 2007 User Excel Discussion (Misc queries) 1 January 30th 09 05:39 PM
customizing text color ai New Users to Excel 2 August 14th 08 08:36 PM
Change column color in chart when column value is over/under goal Excel Charts Charts and Charting in Excel 2 December 10th 07 11:08 PM
Copy Color Formats Based On Column Date Values Naji Excel Discussion (Misc queries) 0 January 11th 06 09:06 PM
customizing chart column color formats in code Papa Jonah Excel Programming 1 March 21st 05 06:15 PM


All times are GMT +1. The time now is 04:19 AM.

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

About Us

"It's about Microsoft Excel"