15.08.2018, 13:35
(Dieser Beitrag wurde zuletzt bearbeitet: 16.08.2018, 09:51 von WillWissen.
Bearbeitungsgrund: Codetags
)
Also ich habe mir mit dem Rekorder folgenden Code Aufgezeichnet:
Jetzt hat er aber bei ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Text = "omega_stiff/omega_norm" ein Problem und will das anscheinend nicht ausführen. Kann mir jemand sagen wie ich das ändern muss. Thx
Code:
Sub ratio_diagram_norm_no()
'
' ratio_diagram_norm_no Makro
' Diagram which plottes the ratio of the diagrams in collum E accrording to the appearnce in the normal simulation
'
'
Columns("E:E").Select
ActiveSheet.Shapes.AddChart2(240, xlXYScatter).Select
ActiveChart.SetSourceData Source:=Range("Tabelle1!$E:$E")
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
ActiveChart.SetElement (msoElementPrimaryValueAxisTitleAdjacentToAxis)
ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Text = "omega_stiff/omega_norm"
Selection.Format.TextFrame2.TextRange.Characters.Text = _
"omega_stiff/omega_norm"
With Selection.Format.TextFrame2.TextRange.Characters(1, 22).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
With Selection.Format.TextFrame2.TextRange.Characters(1, 22).Font
.BaselineOffset = 0
.Bold = msoFalse
.NameComplexScript = "+mn-cs"
.NameFarEast = "+mn-ea"
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(89, 89, 89)
.Fill.Transparency = 0
.Fill.Solid
.Size = 10
.Italic = msoFalse
.Kerning = 12
.Name = "+mn-lt"
.UnderlineStyle = msoNoUnderline
.Strike = msoNoStrike
End With
ActiveChart.Axes(xlCategory).AxisTitle.Select
ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Text = "No of mode"
Selection.Format.TextFrame2.TextRange.Characters.Text = "No of mode"
With Selection.Format.TextFrame2.TextRange.Characters(1, 10).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
With Selection.Format.TextFrame2.TextRange.Characters(1, 10).Font
.BaselineOffset = 0
.Bold = msoFalse
.NameComplexScript = "+mn-cs"
.NameFarEast = "+mn-ea"
.Fill.Visible = msoTrue
.Fill.ForeColor.RGB = RGB(89, 89, 89)
.Fill.Transparency = 0
.Fill.Solid
.Size = 10
.Italic = msoFalse
.Kerning = 12
.Name = "+mn-lt"
.UnderlineStyle = msoNoUnderline
.Strike = msoNoStrike
End With
Range("G21").Select
Application.CommandBars("Format Object").Visible = False
ActiveSheet.ChartObjects("Diagramm 2").Activate
ActiveSheet.Shapes("Diagramm 2").IncrementLeft 393
ActiveSheet.Shapes("Diagramm 2").IncrementTop -66
End Sub
Jetzt hat er aber bei ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Text = "omega_stiff/omega_norm" ein Problem und will das anscheinend nicht ausführen. Kann mir jemand sagen wie ich das ändern muss. Thx