Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional formatting and charts

Status
Not open for further replies.

HappySmiler

IS-IT--Management
Apr 5, 2002
2
CA
Hi! I was wondering if there was a way to apply conditional formatting defined in an excel worksheet to a chart, more precisely to a pie chart... without using vba ?
If anyone has a clue, I would be very grewatful !

A nice day to all.
 
Hey HappySmiler,

Don't believe that Excel has a feature like cell formatting for charts. Your are going to have to do that with VBA. :) Skip,
metzgsk@voughtaircraft.com
 
HappySmiler,

Before we say "no"... what exactly do you want to conditionally happen in your pie chart??
 
It's very simple in fact... I want the chart to exactly do the same thing as the cells in the worksheet. For example, if a value is <8, the value changes to white and the background to dark blue (by using conditional formatting). So in the pie chart, each section which is <8 would be white and blue, the same as the cell. I know I could do it in vba, but would prefer to do it with excel's own tools.
 
If you want to jump through a few spreadsheet equation hoops, you could create a range to capture any items which were <8, and a second contiguous range that contained items which were >=8. Then format any data in the <8 range to be blue, and have it only appear in the pie when the data was not null.

Since it's not an easily-implimented Excel feature, and it sounds like you know VBA, that might be the best approach.
 
Actually, there is a non-vba approch.

You make additional columns so if the value is greather than or less than a threshhold value, is goes into its own set of columns -- the case 1 set of columns used set 1 chart formatting, case 2 set of columns use set 2 chart formatting, etc.

With this type of approch, I was able to format a gantt chart, where the bars would &quot;change colors&quot; based on the data. The data just &quot;appears&quot; in defferent columns based on formulae. Works pretty neat :) Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top