PC Review


Reply
Thread Tools Rate Thread

Changing the value of chart labels

 
 
=?Utf-8?B?anVsaWVqZzE=?=
Guest
Posts: n/a
 
      25th Oct 2006
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 With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      25th Oct 2006
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).DataLabel.Text = _
"[" & ActiveChart.SeriesCollection(3).Points(N).DataLabel.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" <(E-Mail Removed)>
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 With Quote
 
=?Utf-8?B?anVsaWVqZzE=?=
Guest
Posts: n/a
 
      25th Oct 2006
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).DataLabel.Text = _
> "[" & ActiveChart.SeriesCollection(3).Points(N).DataLabel.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" <(E-Mail Removed)>
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to change position of chart labels on line chart Shane Henderson Microsoft Excel Charting 1 27th May 2011 09:31 AM
Stop excel changing chart axes labels when letters are repeated Leslie Haas Microsoft Excel Charting 2 13th Apr 2009 05:37 PM
how to keep data labels in chart in 2007 from changing? =?Utf-8?B?a29qYWtzNDM=?= Microsoft Excel Charting 1 4th Sep 2007 01:23 PM
Changing chart labels in an Access report =?Utf-8?B?TWFyaWU=?= Microsoft Access Reports 1 14th Feb 2005 12:37 PM
excel - chart, changing data labels =?Utf-8?B?bWl0b3Npcw==?= Microsoft Access 1 8th Feb 2004 03:00 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:54 AM.