Hi
im using the following macro to generate a bubble chart. the only issue I have is the .Format.Line.Visible = msoTrue is not being applied to the first series (1st bubble). would someone be able to suggest why this might be happening?
thanks
Public Sub CreateMultiSeriesBubbleChart()
If (Selection.Columns.Count <> 4 Or Selection.Rows.Count < 3) Then
MsgBox "Selection must have 4 columns and at least 2 rows"
Exit Sub
End If
Dim bubbleChart As ChartObject
Set bubbleChart = ActiveSheet.ChartObjects.Add(Left:=Selection.Left, Width:=400, Top:=Selection.Top, Height:=250)
bubbleChart.Chart.ChartType = xlBubble
Dim r As Integer
For r = 2 To Selection.Rows.Count
With bubbleChart.Chart.SeriesCollection.NewSeries
.Name = "=" & Selection.Cells(r, 1).Address(External:=True)
.XValues = Selection.Cells(r, 2).Address(External:=True)
.Values = Selection.Cells(r, 3).Address(External:=True)
.BubbleSizes = Selection.Cells(r, 4).Address(External:=True)
.ApplyDataLabels AutoText:=True, LegendKey:=False, _
ShowSeriesName:=True, ShowCategoryName:=False, ShowValue:=False, _
ShowPercentage:=False, ShowBubbleSize:=True
.Format.Line.Visible = msoTrue
.Format.Line.Weight = 0.5
.Format.Fill.Solid
.Format.Fill.Transparency = 0.45
End With
end sub
im using the following macro to generate a bubble chart. the only issue I have is the .Format.Line.Visible = msoTrue is not being applied to the first series (1st bubble). would someone be able to suggest why this might be happening?
thanks
Public Sub CreateMultiSeriesBubbleChart()
If (Selection.Columns.Count <> 4 Or Selection.Rows.Count < 3) Then
MsgBox "Selection must have 4 columns and at least 2 rows"
Exit Sub
End If
Dim bubbleChart As ChartObject
Set bubbleChart = ActiveSheet.ChartObjects.Add(Left:=Selection.Left, Width:=400, Top:=Selection.Top, Height:=250)
bubbleChart.Chart.ChartType = xlBubble
Dim r As Integer
For r = 2 To Selection.Rows.Count
With bubbleChart.Chart.SeriesCollection.NewSeries
.Name = "=" & Selection.Cells(r, 1).Address(External:=True)
.XValues = Selection.Cells(r, 2).Address(External:=True)
.Values = Selection.Cells(r, 3).Address(External:=True)
.BubbleSizes = Selection.Cells(r, 4).Address(External:=True)
.ApplyDataLabels AutoText:=True, LegendKey:=False, _
ShowSeriesName:=True, ShowCategoryName:=False, ShowValue:=False, _
ShowPercentage:=False, ShowBubbleSize:=True
.Format.Line.Visible = msoTrue
.Format.Line.Weight = 0.5
.Format.Fill.Solid
.Format.Fill.Transparency = 0.45
End With
end sub