Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
nnj
 
Posts: n/a
Default Accessing values in points collection of chart & conditional display


Hi,
I have just started learning Macros &...

I need to read thru the values of each data point in a chart and decide
if the datalabels need to be displayed on the chart.
That is, if the value in a point is less than 1, I do not want the
datalabel displayed for that point.
Is there a way to access the Value of the points array ?
Please help.
I duno in which group the Points belong to . This is how I started
working on it.

Dim p As Points
With ActiveChart
For Each p In ??
If p.Values <= 1 Then
p.HasDataLabels = False
End If
Next p
End With

Thanx in advance


--
nnj
------------------------------------------------------------------------
nnj's Profile: http://www.excelforum.com/member.php...o&userid=25876
View this thread: http://www.excelforum.com/showthread...hreadid=392592

  #2   Report Post  
Jon Peltier
 
Posts: n/a
Default

Sub LabelsIfGreaterThanOne()
Dim vaValues As Variant
Dim iPt As Long
With ActiveChart.SeriesCollection(1)
vaValues = .Values
For iPt = 1 To .Points.Count
If vaValues(iPt) <= 1 Then
.Points(iPt).HasDataLabel = False
End If
Next
End With
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


nnj wrote:

Hi,
I have just started learning Macros &...

I need to read thru the values of each data point in a chart and decide
if the datalabels need to be displayed on the chart.
That is, if the value in a point is less than 1, I do not want the
datalabel displayed for that point.
Is there a way to access the Value of the points array ?
Please help.
I duno in which group the Points belong to . This is how I started
working on it.

Dim p As Points
With ActiveChart
For Each p In ??
If p.Values <= 1 Then
p.HasDataLabels = False
End If
Next p
End With

Thanx in advance


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
Zero values in a log chart Joelle_Smith Charts and Charting in Excel 2 May 8th 23 03:42 AM
Charting data points and show a target range on the same chart. Minireefkeeper Charts and Charting in Excel 6 February 18th 06 06:50 PM
Chart -- How to chart 65536 values in 1 series? kilmaley11 About this forum 0 June 8th 05 11:19 AM
Missing values in Excel Line Chart mw55309 Charts and Charting in Excel 1 January 19th 05 12:10 PM
Newbie to charts question - projecting values between data points 38N90W Excel Discussion (Misc queries) 3 January 6th 05 05:15 AM


All times are GMT +1. The time now is 10:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"