Results 1 to 2 of 2

Thread: SImple Code for Changing Line Weight

  1. #1

    SImple Code for Changing Line Weight

    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?

  2. #2
    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 
    Formatting tags added by mark007
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts