Diagramme formatieren
29.07.2014 10:16:06
Thms
ich habe einige Diagramme, denen ich gernen allen auf einmal einen Titel, Achsenbeschriftungen etc. mit einem bestimmten Format zuführen möchte. Dafür habe ich ein Makro aufgezeichnet, das entsprechende Formatierungen beinhaltet. Ich bräuchte nun nur Hilfe, dass es so angepasst wird, dass es für alle Charts in dem Sheet durchläuft und nicht nur für den Chart, bei dem ich es aufgenommen habe. Geht das?
Hier die Aufzeichnung:
Sub Macro4()
' Macro4 Macro
ActiveChart.SetElement (msoElementChartTitleAboveChart)
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
ActiveChart.SetElement (msoElementPrimaryValueAxisTitleRotated)
ActiveChart.ChartTitle.Select
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "Arial Narrow"
.Name = "Arial Narrow"
End With
Selection.Format.TextFrame2.TextRange.Font.Size = 24
ActiveChart.Legend.Select
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "Arial Narrow"
.Name = "Arial Narrow"
End With
Selection.Format.TextFrame2.TextRange.Font.Size = 14
ActiveChart.Axes("xlCategory").AxisTitle.Select
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "Arial Narrow"
.Name = "Arial Narrow"
End With
Selection.Format.TextFrame2.TextRange.Font.Size = 16
ActiveChart.Axes("xlValue").AxisTitle.Select
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "Arial Narrow"
.Name = "Arial Narrow"
End With
Selection.Format.TextFrame2.TextRange.Font.Size = 16
ActiveChart.Axes("xlValue").Select
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "Arial Narrow"
.Name = "Arial Narrow"
End With
Selection.Format.TextFrame2.TextRange.Font.Size = 14
ActiveChart.Axes("xlCategory").Select
With Selection.Format.TextFrame2.TextRange.Font
.NameComplexScript = "Arial Narrow"
.Name = "Arial Narrow"
End With
Selection.Format.TextFrame2.TextRange.Font.Size = 14
ActiveChart.ChartTitle.Select
End Sub
Beste GrüßeThomas