Working With Graphs

Adding graphs to all worksheets in workbook

[sourcecode language="vb" light="true" wraplines="false" gutter="false"]
Sub AddWorksheets()
    For i = 1 To Worksheets.count
        Worksheets(i).Activate
        Range("A5:M5,A20:M20,A22:M22,A36:M36,A38:M38").Select
        Range("A38").Activate
        ActiveSheet.Shapes.AddChart.Select
        ActiveChart.SetSourceData Source:=Range( _
            "$A$5:$M$5,$A$20:$M$20,$A$22:$M$22,$A$36:$M$36,$A$38:$M$38")
        ActiveChart.ChartType = xlLineMarkers
        With ActiveChart.Parent
            .Height = 220
            .Width = 495
            .Top = 335
            .Left = 320
        End With
    i = i + 1
    Next i
End Sub
[/sourcecode]