Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
496to500
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
496to500
496to500
Aktuelles Verzeichnis
Verzeichnis Index
Verzeichnis Index
Übersicht Verzeichnisse
Inhaltsverzeichnis

diagramme per makro erstellen

diagramme per makro erstellen
13.10.2004 14:41:35
Andrej
Hallo zusammen
leider kenn ich mich diagrammen gar nicht aus. ich habe mir das makro aufgezeuchnet. wie kann ich es dann so modifizieren, dass ich es normal starten kann. wenn ich das über vba laufen lasse, kommt eine fehlermeldung.
hier der code:
Sub dia()

Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source:=Sheets("Tabelle1").Range("A1:K8"), PlotBy _
:=xlColumns
ActiveChart.SeriesCollection(3).Delete
ActiveChart.SeriesCollection(1).XValues = "=Tabelle1!R3C8:R8C8"
ActiveChart.SeriesCollection(1).Values = "=Tabelle1!R3C9:R8C9"
ActiveChart.SeriesCollection(1).Name = ""
ActiveChart.SeriesCollection(2).XValues = "=Tabelle1!R3C10:R8C10"
ActiveChart.SeriesCollection(2).Values = "=Tabelle1!R3C11:R8C11"
ActiveChart.SeriesCollection(2).Name = ""
ActiveChart.Location Where:=xlLocationAsObject, Name:="Tabelle1"
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlValue, xlPrimary) = True
End With
ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = True
.HasMinorGridlines = False
End With
ActiveChart.HasLegend = True
ActiveChart.Legend.Select
Selection.Position = xlTop
ActiveChart.PlotArea.Select
Application.CommandBars("Chart").Visible = True
With Selection.Border
.ColorIndex = 1
.Weight = xlThick
.LineStyle = xlContinuous
End With
Selection.Fill.TwoColorGradient Style:=msoGradientDiagonalDown, Variant:=2
With Selection
.Fill.Visible = True
.Fill.ForeColor.SchemeColor = 43
.Fill.BackColor.SchemeColor = 46
End With
ActiveChart.Axes(xlCategory).MajorGridlines.Select
With Selection.Border
.ColorIndex = 1
.Weight = xlThin
.LineStyle = xlContinuous
End With
With ActiveChart.Axes(xlCategory)
.MinimumScale = 0
.MaximumScale = 100
.MinorUnit = 1
.MajorUnit = 50
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlHundreds
.HasDisplayUnitLabel = True
End With
ActiveChart.Axes(xlCategory).DisplayUnitLabel.Select
ActiveChart.Axes(xlCategory).MajorGridlines.Select
With ActiveChart.Axes(xlCategory)
.MinimumScale = 0
.MaximumScale = 100
.MinorUnit = 1
.MajorUnit = 50
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
ActiveChart.Axes(xlValue).MajorGridlines.Select
With ActiveChart.Axes(xlValue)
.MinimumScale = 0
.MaximumScale = 100
.MinorUnit = 1
.MajorUnit = 50
.Crosses = xlAutomatic
.ReversePlotOrder = False
.ScaleType = xlLinear
.DisplayUnit = xlNone
End With
ActiveChart.SeriesCollection(1).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlNone
End With
With Selection
.MarkerBackgroundColorIndex = 3
.MarkerForegroundColorIndex = 1
.MarkerStyle = xlCircle
.Smooth = False
.MarkerSize = 25
.Shadow = False
End With
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.Weight = xlHairline
.LineStyle = xlNone
End With
With Selection
.MarkerBackgroundColorIndex = 4
.MarkerForegroundColorIndex = 1
.MarkerStyle = xlCircle
.Smooth = False
.MarkerSize = 25
.Shadow = False
End With
vielen dank
Andrej

2
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: diagramme per makro erstellen
Bert
Funktioniert doch, fehlt nur ein End Sub am Ende.
Bert
AW: diagramme per makro erstellen
andrej
danke. klappt jetzt auch bei mir. kannst du mir vielleicht weiter helfen. dieses diagramm hat jeweils 2 kategorien. ich möchte das diagramm so modifizieren, dass ein pfeil erzeugt wird und zwar so:
vom punkt x1y1 nach x2y2 für alle datenpaare.
vielen dank andrej

Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige