Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default Looping Through Chart Labels

Hello.

I am trying to write a loop (such as a For...Next or Do Until) to loop
through all the Datalabels in a chart, evaluate whether they are below 3%
value, and if so to remove the labels.

There is only one SeriesCollection with multiple points (about 50.)

I have written this code before to success, but using a Range to check for
the value and not in a loop. Anyone out there help me or point me in the
right direction? I appreciate the help.

Thanks

Dan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Looping Through Chart Labels

Here is some starting code for you.

Dim DL As DataLabel

ActiveChart.ApplyDataLabels ShowValue:=True

For Each DL In ActiveChart.SeriesCollection(1).DataLabels
If CDbl(Left(DL.Text, Len(DL.Text) - 1)) < 3 Then
DL.Delete
End If
Next


Chrissy.

"Dan Gesshel" wrote in message ...
Hello.

I am trying to write a loop (such as a For...Next or Do Until) to loop
through all the Datalabels in a chart, evaluate whether they are below 3%
value, and if so to remove the labels.

There is only one SeriesCollection with multiple points (about 50.)

I have written this code before to success, but using a Range to check for
the value and not in a loop. Anyone out there help me or point me in the
right direction? I appreciate the help.

Thanks

Dan




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Looping Through Chart Labels

Here's a non-vba solution. Double click on the labels to format them,
click on the Number tab, and assign a custom number format like this one:

[<0.03]"";0%

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

Dan Gesshel wrote:
Hello.

I am trying to write a loop (such as a For...Next or Do Until) to loop
through all the Datalabels in a chart, evaluate whether they are below 3%
value, and if so to remove the labels.

There is only one SeriesCollection with multiple points (about 50.)

I have written this code before to success, but using a Range to check for
the value and not in a loop. Anyone out there help me or point me in the
right direction? I appreciate the help.

Thanks

Dan



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
Macro to change position of chart labels on line chart Shane Henderson[_2_] Charts and Charting in Excel 1 May 27th 11 09:31 AM
Pie Chart and Zero Value Labels Hardip Charts and Charting in Excel 1 August 7th 09 09:21 AM
Chart labels disappear - How do I refresh the chart? jcloydjcloyd Charts and Charting in Excel 0 March 30th 06 07:49 PM
chart labels? X Charter Charts and Charting in Excel 1 May 4th 05 05:57 AM
Labels on a chart Kevin Charts and Charting in Excel 1 February 10th 05 09:16 AM


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