Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bubble Chart Labels 2

Status
Not open for further replies.

BlaineR

IS-IT--Management
Aug 27, 2001
53
0
0
CA
Hi,

In my Excel 2007 bubble chart, I want to label my bubbles using the associated values in a column called Project Name.

I know that "out of the box", Excel lets you label using: Series Name or X Value or Y Value or Bubble Size -- but I don't want these.

I know I could also "manually" go in to each label and make a reference to the associated cell in the Project Name column, but this is pretty tedious.

I'd appreciate any suggestions.

Thanks,
Blaine
 


Hi,

1. Assign a NAMED RANGE of BubbleName to the names you want the bubble data labels.

2. Select your chart

3. run this code...
Code:
Sub NameBubbles()
    Dim pt As Point, i As Integer
    
    With ActiveChart
        .SeriesCollection(1).HasDataLabels = True
        i = 1
        For Each pt In .SeriesCollection(1).Points
            pt.DataLabel.Caption = Range("BubbleName")(i)
            i = i + 1
        Next
    End With
End Sub

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Sweet! Works like a charm. You're awesome, Skip.

Thanks,
Blaine
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top