PC Review


Reply
Thread Tools Rate Thread

Accessing values in points collection of chart & conditional display

 
 
nnj
Guest
Posts: n/a
 
      3rd Aug 2005

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

 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      3rd Aug 2005
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 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
Accessing Points in a Line Chart Techno_Dex Microsoft Excel Charting 3 12th Aug 2006 12:00 AM
Re: how do I conditional format data points on a chart Jon Peltier Microsoft Excel Charting 0 23rd Sep 2004 05:03 AM
how do I conditional format data points on a chart =?Utf-8?B?Um9i?= Microsoft Excel Charting 0 22nd Sep 2004 01:53 PM
Conditional Format Chart Points Sprinkles Microsoft Excel Misc 1 12th Mar 2004 04:53 AM
Scatter chart, conditional format data points Sprinkles Microsoft Excel Charting 1 11th Mar 2004 04:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:49 PM.