Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
multiple charts on one sheet | Charts and Charting in Excel | |||
Creating Multiple Pie Charts from Excel Sheet | Charts and Charting in Excel | |||
multiple pivote charts in one sheet | Excel Discussion (Misc queries) | |||
How do I place multiple charts in the same sheet? | Charts and Charting in Excel | |||
Print multiple excel charts within one sheet to fit to a page lik. | Excel Discussion (Misc queries) |