Thanks for your assistance.
--
I Teach
"Herbert Seidenberg" wrote:
> .
>
The legend contains the Names of each series. So you would need to create a
series for each Company.
There is a limit of 255 series.
Cheers
Andy
--
Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"I Teach" <Ite...@discussions.microsoft.com> wrote in message
news:B59B6A17-F39F-424D...@microsoft.com...
"Andy Pope" wrote:
> .
>
Right-click the chart and pick Select Data. You can use the Add button
to create new series and pick the cell for Name and Values.
Cheers
Andy
I Teach wrote:
> Thanks, Andy. Please tell me how to do that in Excel 2007.
--
Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
Here is the macro from Herbert Seidenberg to create data labels next to each
bubble. Could you please help me to change the macro so that a legend is
created on the right, rather than data labels.
Thanks for your assistance.
Sub PointLabel()
Dim m As Variant
Dim i As Integer
Dim y As Integer
With Sheets("Data").ListObjects("Table1")
y = .ListRows.Count
End With
With Sheets("Data")
m = Range("Table1[NName]")
End With
With Sheets("Bubble").SeriesCollection(1)
.ApplyDataLabels
For i = 1 To y
.Points(i).DataLabel.Text = m(i, 1)
Next i
End With
End Sub
--
I Teach
"Andy Pope" wrote:
> .
>
Sub x()
Dim objCht As Chart
Dim rngData As Range
Dim lngRow As Long
Set objCht = ActiveSheet.ChartObjects.Add(100, 100, 300, 200).Chart
Set rngData = ActiveSheet.ListObjects(1).Range
Set rngData = rngData.Offset(1, 0).Resize(rngData.Rows.Count - 1)
objCht.ChartType = xlBubble
For lngRow = 1 To rngData.Rows.Count
If Len(rngData.Cells(lngRow, 4)) > 0 Then
With objCht.SeriesCollection.NewSeries
.Name = rngData.Cells(lngRow, 4)
.XValues = rngData.Cells(lngRow, 1)
.Values = rngData.Cells(lngRow, 2)
.BubbleSizes = rngData.Cells(lngRow, 3)
End With
End If
Next
End Sub
After the code is run check the Select Data dialog to see the range
references each series has.
Cheers
Andy
--
Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"I Teach" <Ite...@discussions.microsoft.com> wrote in message
news:093B50C7-C3DF-4691...@microsoft.com...
Please let me know.
--
I Teach
"Andy Pope" wrote:
> .
>
Set rngData = ActiveSheet.Range("A1").currentregion
Of course you would need to amend the row/column indexes so you got a
reference to the correct data.
Cheers
Andy
--
Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
"I Teach" <Ite...@discussions.microsoft.com> wrote in message
news:D2463534-82F2-42DA...@microsoft.com...
I appreciate all your help and everything worked well.
--
I Teach
"Andy Pope" wrote:
> .
>