Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing the value of chart labels
I have a stacked column chart based on data as follows:
2005 Exchange Volume Inflation Price Blank 1,862 1,844 1,844 2,210 Up 0 93 0 402 0 Down 0 111 0 36 The 'Down' values are actually negative amounts but have to be shown as positives for the chart to work properly. My question is, I woulld like the lables in the chart for the 'Down' values to be put in brackets to represent negative numbers. However, since the values have to be positive for this chart to function properly, simply changing the formatting on the cells will not work. Is there code I can write for this chart to show any values higher than zero to be put in brackets? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing the value of chart labels
Here is some code that should be close to what you want...
Sub ChartLabelTest() Dim lngCount As Long Dim N As Long lngCount = ActiveChart.SeriesCollection(3).Points.Count For N = 1 To lngCount ActiveChart.SeriesCollection(3).Points(N).DataLabe l.Text = _ "[" & ActiveChart.SeriesCollection(3).Points(N).DataLabe l.Text & "]" Next 'N End Sub ----------- Or you could try out the free Excel add-in "Chart Data Labels", as it can place formatted linked values from worksheet cells as the text in your data labels. Download from ... http://www.realezsites.com/bus/primitivesoftware No registration required. Jim Cone San Francisco, USA "juliejg1" wrote in message I have a stacked column chart based on data as follows: 2005 Exchange Volume Inflation Price Blank 1,862 1,844 1,844 2,210 Up 0 93 0 402 0 Down 0 111 0 36 The 'Down' values are actually negative amounts but have to be shown as positives for the chart to work properly. My question is, I woulld like the lables in the chart for the 'Down' values to be put in brackets to represent negative numbers. However, since the values have to be positive for this chart to function properly, simply changing the formatting on the cells will not work. Is there code I can write for this chart to show any values higher than zero to be put in brackets? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing the value of chart labels
Thanks Jim. I'll give it a try!
"Jim Cone" wrote: Here is some code that should be close to what you want... Sub ChartLabelTest() Dim lngCount As Long Dim N As Long lngCount = ActiveChart.SeriesCollection(3).Points.Count For N = 1 To lngCount ActiveChart.SeriesCollection(3).Points(N).DataLabe l.Text = _ "[" & ActiveChart.SeriesCollection(3).Points(N).DataLabe l.Text & "]" Next 'N End Sub ----------- Or you could try out the free Excel add-in "Chart Data Labels", as it can place formatted linked values from worksheet cells as the text in your data labels. Download from ... http://www.realezsites.com/bus/primitivesoftware No registration required. Jim Cone San Francisco, USA "juliejg1" wrote in message I have a stacked column chart based on data as follows: 2005 Exchange Volume Inflation Price Blank 1,862 1,844 1,844 2,210 Up 0 93 0 402 0 Down 0 111 0 36 The 'Down' values are actually negative amounts but have to be shown as positives for the chart to work properly. My question is, I woulld like the lables in the chart for the 'Down' values to be put in brackets to represent negative numbers. However, since the values have to be positive for this chart to function properly, simply changing the formatting on the cells will not work. Is there code I can write for this chart to show any values higher than zero to be put in brackets? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Changing X Axis labels but doesn't change chart | Charts and Charting in Excel | |||
Changing y axis labels | Charts and Charting in Excel | |||
Stop excel changing chart axes labels when letters are repeated | Charts and Charting in Excel | |||
how to keep data labels in chart in 2007 from changing? | Charts and Charting in Excel | |||
Changing the inner border of bar labels? | Charts and Charting in Excel |