I'm trying to find a way to execute a script that will format a selected chart. If the chart has a X series, in which some have lines, and others, I just wanted the markers displayed, I need the VBA to format the line thickness of just the series that has a line and ignore the series with just the marker. The code I have below formats the all series, so if my chart has just markers on it, when I run the code, it will then apply a line to the marker series even though I don't want it to.
Sub line_thickness()
Dim objSeries As Series
With ActiveChart
For Each objSeries In .SeriesCollection
With objSeries.Format.Line
.Weight = 2
' .ForeColor.RGB = RGB(100, 100, 100)
End With
With objSeries
' .MarkerBackgroundColor = RGB(102, 0, 102) 'purple
' .MarkerForegroundColor = RGB(102, 0, 102) ' purple
' .MarkerStyle = xlX
' .Smooth = False
.MarkerSize = 4
' .Shadow = False
End With
Next
End With
End Sub
Sub line_thickness()
Dim objSeries As Series
With ActiveChart
For Each objSeries In .SeriesCollection
With objSeries.Format.Line
.Weight = 2
' .ForeColor.RGB = RGB(100, 100, 100)
End With
With objSeries
' .MarkerBackgroundColor = RGB(102, 0, 102) 'purple
' .MarkerForegroundColor = RGB(102, 0, 102) ' purple
' .MarkerStyle = xlX
' .Smooth = False
.MarkerSize = 4
' .Shadow = False
End With
Next
End With
End Sub