Hey guys,
I am attempting to put 3 axis labels and 1 chart title on a chart but only 1 axis label is working. Any help with adding the 3 addition labels would be appreciated.
Thanks in advance.
I am attempting to put 3 axis labels and 1 chart title on a chart but only 1 axis label is working. Any help with adding the 3 addition labels would be appreciated.
Thanks in advance.
Code:
Sub Fatigue_Strainnew()
'
' Fatigue_Strainnew Macro
'
'
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(10).Select
Selection.Delete
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(4).Select
Selection.Delete
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(1).Select
ActiveChart.FullSeriesCollection(2).Select
Selection.Delete
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(2).Select
Selection.Delete
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(4).Select
Selection.Delete
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(2).Select
Selection.Delete
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(2).Select
Selection.Delete
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(4).Select
ActiveChart.FullSeriesCollection(4).AxisGroup = 2
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(4).Select
ActiveChart.FullSeriesCollection(3).Select
ActiveChart.FullSeriesCollection(3).AxisGroup = 2
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(3).Select
ActiveChart.FullSeriesCollection(2).Select
ActiveChart.FullSeriesCollection(2).AxisGroup = 2
ActiveChart.ChartArea.Select
ActiveChart.FullSeriesCollection(2).Select
ActiveChart.FullSeriesCollection(4).Select
With Selection.Format.Line
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorAccent4
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = 0
.Transparency = 0
End With
ActiveChart.FullSeriesCollection(2).Select
With Selection.Format.Line
.Visible = msoTrue
.ForeColor.RGB = RGB(192, 0, 0)
.Transparency = 0
End With
ActiveChart.FullSeriesCollection(3).Select
With Selection.Format.Line
.Visible = msoTrue
.ForeColor.ObjectThemeColor = msoThemeColorBackground2
.ForeColor.TintAndShade = 0
.ForeColor.Brightness = -0.75
.Transparency = 0
End With
With Selection.Format.Line
.Visible = msoTrue
.DashStyle = msoLineSysDash
End With
ActiveChart.SetElement (msoElementPrimaryCategoryAxisTitleAdjacentToAxis)
ActiveChart.SetElement (msoElementPrimaryValueAxisTitleAdjacentToAxis)
ActiveChart.SetElement (msoElementSecondaryValueAxisTitleAdjacentToAxis)
ActiveChart.Axes(xlValue, xlSecondary).AxisTitle.Text = "Temperature (°C)"
Selection.Format.TextFrame2.TextRange.Characters.Text = "Temperature (°C)"
With Selection.Format.TextFrame2.TextRange.Characters(1, 16).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
With Selection.Format.TextFrame2.TextRange.Characters(1, 13).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
With Selection.Format.TextFrame2.TextRange.Characters(14, 3).Font
.BaselineOffset = 0
.Bold = msoFalse
.NameComplexScript = "Calibri"
.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 = "Calibri"
.UnderlineStyle = msoNoUnderline
.Strike = msoNoStrike
End With
ActiveChart.Axes(xlValue).AxisTitle.Select
ActiveChart.Axes(xlValue, xlPrimary).AxisTitle.Text = "Strain (µe)"
Selection.Format.TextFrame2.TextRange.Characters.Text = "Strain (µe)"
With Selection.Format.TextFrame2.TextRange.Characters(1, 11).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
With Selection.Format.TextFrame2.TextRange.Characters(1, 8).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
With Selection.Format.TextFrame2.TextRange.Characters(9, 1).Font
.BaselineOffset = 0
.Bold = msoFalse
.NameComplexScript = "Calibri"
.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 = "Calibri"
.UnderlineStyle = msoNoUnderline
.Strike = msoNoStrike
End With
With Selection.Format.TextFrame2.TextRange.Characters(10, 1).Font
.BaselineOffset = 0
.Bold = msoFalse
.NameComplexScript = "Calibri"
.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 = "Calibri"
.UnderlineStyle = msoNoUnderline
.Strike = msoNoStrike
End With
With Selection.Format.TextFrame2.TextRange.Characters(11, 1).Font
.BaselineOffset = 0
.Bold = msoFalse
.NameComplexScript = "Calibri"
.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 = "Calibri"
.UnderlineStyle = msoNoUnderline
.Strike = msoNoStrike
End With
ActiveChart.Axes(xlCategory).AxisTitle.Select
ActiveChart.Axes(xlCategory, xlPrimary).AxisTitle.Text = "Hour of Day"
Selection.Format.TextFrame2.TextRange.Characters.Text = "Hour of Day"
With Selection.Format.TextFrame2.TextRange.Characters(1, 11).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
With Selection.Format.TextFrame2.TextRange.Characters(1, 11).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.ChartTitle.Select
ActiveChart.ChartTitle.Text = "Bellvista SiteStrain 1"
Selection.Format.TextFrame2.TextRange.Characters.Text = _
"Bellvista SiteStrain 1"
With Selection.Format.TextFrame2.TextRange.Characters(1, 23).ParagraphFormat
.TextDirection = msoTextDirectionLeftToRight
.Alignment = msoAlignCenter
End With
With Selection.Format.TextFrame2.TextRange.Characters(1, 23).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 = 14
.Italic = msoFalse
.Kerning = 12
.Name = "+mn-lt"
.UnderlineStyle = msoNoUnderline
.Spacing = 0
.Strike = msoNoStrike
End With
ActiveChart.PlotArea.Select
ActiveChart.ChartArea.Select
End Sub
(/code]