View Full Version : SImple Code for Changing Line Weight
jahinton
03-19-2017, 09:39 AM
I'm new to VBA - as in BRAND new. i've tried to research what I need to do and tried various ideas but I just can't seem to get there. What I would like to do is change the line weight for all lines in all line graphs in all slides in my Powerpoint presentation. They are all currently set at a weight of 2 and I would like them to be 1.5. Can someone help me?
John Wilson
03-20-2017, 09:27 AM
Charts are poorly supported in early versions. Assuming you have a recent version try this
Sub fixChart()
Dim osld As Slide
Dim oshp As Shape
Dim ocht As Chart
Dim ser As Series
Dim L As Long
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.HasChart Then
Set ocht = oshp.Chart
If ocht.ChartType = xlLine Then
For L = 1 To ocht.SeriesCollection.Count
Set ser = ocht.SeriesCollection(L)
ser.Format.Line.Weight = 1.5
Next L
End If
End If
Next oshp
Next osld
End Sub
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.