LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 1
Default Charts in Multiple Sheet in Excel

I am new to the VBA programming & I am trying to develop a VBA script
which will create charts (as a separate worksheet) for each worksheet
in a workbook.

Sub drill()

For i = 1 To Sheets.Count
Sheets("Sheet(i)").Select
Range("A8:I12").Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet(i)").Range( _
"A8:I12"), PlotBy:=xlRows
ActiveChart.Location Whe=xlLocationAsNewSheet, Name:="Oxygen
Chart"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Oxygen Chart"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "US
Average"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Amount
Serviced"
End With
ActiveChart.ChartArea.Select
ActiveWindow.Zoom = 100
ActiveChart.Axes(xlValue).Select
Selection.TickLabels.NumberFormat = "$#,##0_);[Red]($#,##0)"
Sheets("Sheet(i)").Select
Range("A7").Select
Next i

End Sub

I get the error 'Subscript out of Range' Error.
If you can provide any hint to teh solution it will be of great help.

Also, if you have any suggestion of a good book/ resource for VBA,
please let me know.

Thanks,
Alice
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple charts on one sheet afdmello Charts and Charting in Excel 1 June 20th 09 10:52 PM
Creating Multiple Pie Charts from Excel Sheet geezey Charts and Charting in Excel 1 September 5th 08 03:37 AM
multiple pivote charts in one sheet squared chart area[_2_] Excel Discussion (Misc queries) 0 June 13th 07 01:09 PM
How do I place multiple charts in the same sheet? ledmari Charts and Charting in Excel 4 September 19th 05 06:56 PM
Print multiple excel charts within one sheet to fit to a page lik. lal Excel Discussion (Misc queries) 1 February 18th 05 09:47 PM


All times are GMT +1. The time now is 06:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"