Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Chart - conditional formatting

Hi Everyone,

In order to change conditionally the colours of my data series in a Chart
based on the colours set in a range named "pallet", I used the following
code. The only problem is that I need to work in a Clustered Column chart and
the colour conditionality is based on the Category label, not on the Serie.

Example :

Category Serie
Flowers 5%
Clothes 2%
Food 15%
etc. I would like to select the colour according to the name of the category
(ie Flowers = yellow, Clothes = blue, etc).

Actually, the routine uses the serie values, as shown in line 4
(DataLabel)of the code. How should I modify this routine to see it work
properly with the category name displayed on the X Axis ?

Sub SeriesColours()
Sheets("Sheet1").ChartObjects(1).Activate
For Each ppt In ActiveChart.SeriesCollection(1).Points
labl = ppt.DataLabel.Caption
Sheets("Sheet1").Range("pallet").Select
Selection.Find(What:=labl, After:=ActiveCell).Activate
scolor = ActiveCell.Interior.ColorIndex
Sheets("Sheet1").ChartObjects("Chart 1").Activate
ppt.Interior.ColorIndex = scolor
Next
Sheets("Sheet1").Cells(1).Select
End Sub

TIA for your cooperation
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
Chart with conditional formatting Charles Charts and Charting in Excel 2 October 16th 07 08:36 PM
Chart Conditional Formatting Jus Excel Discussion (Misc queries) 1 August 29th 06 08:14 PM
chart conditional formatting bob777 Excel Discussion (Misc queries) 1 November 28th 05 10:48 AM
Conditional formatting a bar chart Caro-Kann Defence Charts and Charting in Excel 2 September 13th 05 01:52 PM
Conditional formatting in a chart Baro Charts and Charting in Excel 3 June 27th 05 06:01 AM


All times are GMT +1. The time now is 10:20 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"