AW: Diagrammgröße und Position per Makro verändern
18.01.2006 19:39:00
K.Rola
Hallo,
Sub Diagramm_()
Range("D1:E1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Sort Key1:=Range("E1"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Daten Pareto").Range("D1:Ezeilen"), _
PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Ausgabe"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "fehlerauswertung" & " vom " & Start & " bis " & ende
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Fehlerort"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Anzahl"
End With
With ActiveChart.Axes(xlCategory)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Axes(xlValue)
.HasMajorGridlines = False
.HasMinorGridlines = False
End With
With ActiveChart.Parent
.Left = 50 'Links
.Top = 50 'Oben
.Width = 400 'Breite
.Height = 300 'Höhe
End With
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).ApplyDataLabels AutoText:=True, LegendKey:= _
False, ShowSeriesName:=False, ShowCategoryName:=False, ShowValue:=True, _
ShowPercentage:=False, ShowBubbleSize:=False
With ActiveChart.ChartGroups(1)
.Overlap = 0
.GapWidth = 20
.HasSeriesLines = False
.VaryByCategories = False
End With
ActiveChart.Legend.Select
Selection.Delete
End Sub
Gruß K.Rola