Hello,
I have several charts with multiple series in one worksheet and I want to format line thickness, marker size and marker type for all the series of all these charts.
This is my first time with VBA coding and here is the code I wrote to try to do that:
Sub LoopThroughCharts()
Dim cht As ChartObject
Dim ser As Series
For Each cht In ActiveSheet.ChartObjects
For Each ser In cht.SeriesCollection
ser.Format.Line.Weight = 0.5
ser.MarkerSize = 5
ser.MarkerStyle = xlMarkerStyleCircle
Next ser
Next cht
End Sub
But I have a "Run-Time error '438': Object doesn't support this property of method" when I reach the "ser.Format.Line.Weight=0.5" line.
I have double-checked and all the properties I used for ser, a Series object, are Series properties so I just don't understand why this code doesn't work.
What's wrong with my code?
Thanks for any help!
Bookmarks