View Single Post
  #1   Report Post  
Karl
 
Posts: n/a
Default Conditional Datalabel formating

Hello,
We have a Excel 2003 worksheet named 'OBQI 2004' that has multiple
embedded column charts.

Here is the source data for one of the charts:

F G H

85 (Prior) (Current)
86 MO700 32% 32%
87 MO690 40% 41%
88 MO420 53% 52%
89 No Prior Data 37%
90 MO670 56% 55%
91 MO780 34% 33%
92 No Prior Data 50%
93 No Prior Data 57%

So the data range value is: ='OBQI 2004'!$F$85:$H$93

Each chart has two series:

Series 1
Name: ='OBQI 2004'!$G$85
Values: ='OBQI 2004'!$G$86:$G$93

Series 2
Name: ='OBQI 2004'!$H$85
Values: ='OBQI 2004'!$H$86:$H$93

For each chart the datalabels for series 1 has been removed.

The datalabels for series 2 has been positioned at the bottom of each
column.

ok... here's the question.

I need to format each series 2 datalabel to have a white background and
red font if the value of Column H(Current) - Column G(Prior) is less
than 0. Otherwise, the datalabel is formated with a green background
with a black font.

This is currently a manual process that I would like to automate.

Can this be done in VBA? Can someone please provide me with or point me
to an example?

TIA

Karl