ziad alsayed
Well-known Member
- Joined
- Jul 17, 2010
- Messages
- 665
dear all
the below code is giving error when it reach the level of posistion the chart.
Appreciate any asssitance.
the below code is giving error when it reach the level of posistion the chart.
Code:
Sub AddChart()
For Each ws In ActiveWorkbook.Worksheets
ws.Select
Range("A1:M6").Select
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ApplyChartTemplate ("C:\Users\Ziad Alsayed\AppData\Roaming\Microsoft\Templates\Charts\Columns By Month.crtx")
ws.Shapes.AddChart(xlColumnClustered, _
Left:=ws.Range("A8").Left, _
Top:=ws.ranege("A8").Top, _
Width:=ws.Range("A8:N8").Width, _
Height:=ws.Range("A8:N20").Height).Select
ActiveChart.SetSourceData Source:=ws.Range("$A$1:$M$6")
ActiveChart.Axes(xlValue).Select
ActiveChart.Axes(xlValue).MinimumScale = 0
Range("A1:A6,N1:N6").Select
Range("N1").Activate
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ApplyChartTemplate ("C:\Users\Ziad Alsayed\AppData\Roaming\Microsoft\Templates\Charts\Columns By Year.crtx")
ActiveChart.SetSourceData Source:=ws.Range("$A$1:$A$6,$N$1:$N$6")
ActiveChart.Axes(xlValue).Select
ActiveChart.Axes(xlValue).MinimumScale = 0
Next ws
End Sub
Appreciate any asssitance.