#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Data Labels

Hello,
Is there a way to determine how many data labels a series has? Thanks.

Bill


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Data Labels

Hi Bill,

Try this routine.
The error trap should handle problems caused by missing or gaps in your
data plus the deletion of individual data labels within a series.

Sub x()
Dim intSeries As Integer
Dim intPoint As Integer
Dim intCountDataLabels As Integer

On Error GoTo ErrCount

With ActiveChart
For intSeries = 1 To .SeriesCollection.Count
With .SeriesCollection(intSeries)
If .HasDataLabels Then
intCountDataLabels = 0
For intPoint = 1 To .Points.Count
If .Points(intPoint).HasDataLabel Then
If Err.Number = 0 Then _
intCountDataLabels = intCountDataLabels + 1
End If
Next
MsgBox "Series " & intSeries & " has " & _
intCountDataLabels & " of out a possible " & .Points.Count
Else
MsgBox "Series " & intSeries & " has no data labels"
End If
End With
Next
End With

Exit Sub
ErrCount:
intCountDataLabels = intCountDataLabels - 1
Resume Next
End Sub

Cheers
Andy

Bill wrote:

Hello,
Is there a way to determine how many data labels a series has? Thanks.

Bill



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
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
How select all data points/data labels at once (to format)? kippers Charts and Charting in Excel 3 April 4th 23 12:39 PM
Data Labels- POssible to show data value and data label together? kippers Charts and Charting in Excel 1 April 1st 09 01:33 PM
Setting hover data labels to cells other than source data Darren Charts and Charting in Excel 1 January 24th 06 10:20 AM
Setting hover data labels to cells other than source data Darren Excel Discussion (Misc queries) 0 January 24th 06 08:31 AM
renaming data labels by different cells than source data Darren Charts and Charting in Excel 4 January 12th 06 10:35 AM


All times are GMT +1. The time now is 10:28 AM.

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"