Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default 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
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
Changing X Axis labels but doesn't change chart Tboyce Charts and Charting in Excel 0 September 29th 10 06:21 PM
Changing y axis labels jc Charts and Charting in Excel 1 May 26th 09 01:36 PM
Stop excel changing chart axes labels when letters are repeated Leslie Haas Charts and Charting in Excel 2 April 13th 09 05:37 PM
how to keep data labels in chart in 2007 from changing? kojaks43 Charts and Charting in Excel 1 September 4th 07 01:23 PM
Changing the inner border of bar labels? Xaver Hinterhuber Charts and Charting in Excel 0 June 3rd 05 12:47 PM


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