Thema Datum  Von Nutzer Rating
Antwort
28.11.2014 12:01:18 david staudnger
NotSolved
Blau according to my lights
29.11.2014 20:57:36 Gast1277
NotSolved
01.12.2014 07:42:22 david
NotSolved
01.12.2014 11:32:20 Gast1277
NotSolved

Ansicht des Beitrags:
Von:
Gast1277
Datum:
29.11.2014 20:57:36
Views:
764
Rating: Antwort:
  Ja
Thema:
according to my lights
Option Explicit

Sub TryThis()
Dim oWsh As Worksheet
Dim oShp As Shape
Dim oChart As Chart
Dim oColl As Series
Dim oPoint As Point
Dim oDtaLabel As DataLabel
Dim rngUsed As Range, rngSource As Range, rngData As Range
Dim rngX As Range, rngY As Range, rngBubble As Range
Dim x As Long

'assuming:
'SourceData Source = Activesheet
'SourceData Source = .Columns(1) to .Columns(2)
'name the points with the 3rd column-values bubbles in .Columns(3)
'SourceData Source = Header .Rows(1)

Set oWsh = ThisWorkbook.ActiveSheet

With oWsh
   For Each oShp In .Shapes
      oShp.Delete                                  'if desired
   Next oShp

   Set rngUsed = .Cells(1, 1).CurrentRegion        'schedule necessary ranges
   
   Set rngData = rngUsed.Offset(1, 0).Resize(rngUsed.Rows.Count - 1, _
      rngUsed.Columns.Count)
      
   Set rngX = rngData.Columns(1)
   Set rngY = rngData.Columns(2)
   Set rngBubble = rngData.Columns(3)

   Set oShp = .Shapes.AddChart(xlBubble)           'add chart
   Set oChart = oShp.Chart
   With oChart
      .SetSourceData Source:=Range(rngX, rngY)
      .Legend.Delete                               'if desired
      
      Set oColl = .SeriesCollection(1)             'just constituted
      For Each oPoint In oColl.Points
         oPoint.ApplyDataLabels                    'make it
         x = x + 1
         oPoint.DataLabel.Text = rngBubble.Cells(x).Value
         'just for fun
         On Error Resume Next
         oPoint.Format.Fill.ForeColor.SchemeColor = x + 1
         On Error GoTo 0
         'so refer to appropriate object
      Next oPoint
   
   End With
   
   With oShp
      .Top = 200                                   'refer to appropriate object
      .Left = 200
   End With

End With

End Sub

 


Ihre Antwort
  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen
Thema: Name: Email:



  • Bitte beschreiben Sie Ihr Problem möglichst ausführlich. (Wichtige Info z.B.: Office Version, Betriebssystem, Wo genau kommen Sie nicht weiter)
  • Bitte helfen Sie ebenfalls wenn Ihnen geholfen werden konnte und markieren Sie Ihre Anfrage als erledigt (Klick auf Häckchen)
  • Bei Crossposting, entsprechende Links auf andere Forenbeiträge beifügen / nachtragen
  • Codeschnipsel am besten über den Code-Button im Text-Editor einfügen
  • Die Angabe der Emailadresse ist freiwillig und wird nur verwendet, um Sie bei Antworten auf Ihren Beitrag zu benachrichtigen

Thema Datum  Von Nutzer Rating
Antwort
28.11.2014 12:01:18 david staudnger
NotSolved
Blau according to my lights
29.11.2014 20:57:36 Gast1277
NotSolved
01.12.2014 07:42:22 david
NotSolved
01.12.2014 11:32:20 Gast1277
NotSolved