Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trying to make loop to create series of charts in Excel 2003
I'm trying to create a loop to generate a new chart for each column in a
spreadsheet. Macro recorder creates code like this, which I want to change to the indexed cell format: ActiveChart.SeriesCollection(1).XValues = "=Data!R3C4:R14C4" I've tried this, but it doesn't seem to work: ActiveChart.SeriesCollection(1).XValues = Worksheets("Data").Range(Cells(3, 1), Cells(3, 14)) |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trying to make loop to create series of charts in Excel 2003
When the chart is active, Excel can't find cells on it. You need something
like this: ActiveChart.SeriesCollection(1).XValues = Worksheets("Data").Range(Worksheets("Data").Cells( 3, 1), Worksheets("Data").Cells(3, 14)) or With Worksheets("Data") ActiveChart.SeriesCollection(1).XValues = .Range(.Cells(3, 1), .Cells(3, 14)) End With Note the dots in front of Range and Cells. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services, Inc. http://PeltierTech.com/WordPress/ _______ "JeffL" wrote in message ... I'm trying to create a loop to generate a new chart for each column in a spreadsheet. Macro recorder creates code like this, which I want to change to the indexed cell format: ActiveChart.SeriesCollection(1).XValues = "=Data!R3C4:R14C4" I've tried this, but it doesn't seem to work: ActiveChart.SeriesCollection(1).XValues = Worksheets("Data").Range(Cells(3, 1), Cells(3, 14)) |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trying to make loop to create series of charts in Excel 2003
Thanks, this does exactly what I need.
"Jon Peltier" wrote: When the chart is active, Excel can't find cells on it. You need something like this: ActiveChart.SeriesCollection(1).XValues = Worksheets("Data").Range(Worksheets("Data").Cells( 3, 1), Worksheets("Data").Cells(3, 14)) or With Worksheets("Data") ActiveChart.SeriesCollection(1).XValues = .Range(.Cells(3, 1), .Cells(3, 14)) End With Note the dots in front of Range and Cells. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services, Inc. http://PeltierTech.com/WordPress/ _______ "JeffL" wrote in message ... I'm trying to create a loop to generate a new chart for each column in a spreadsheet. Macro recorder creates code like this, which I want to change to the indexed cell format: ActiveChart.SeriesCollection(1).XValues = "=Data!R3C4:R14C4" I've tried this, but it doesn't seem to work: ActiveChart.SeriesCollection(1).XValues = Worksheets("Data").Range(Cells(3, 1), Cells(3, 14)) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 how to create charts compatible with 2003? | Charts and Charting in Excel | |||
HOW DO i CREATE 3 PIE CHARTS SIDE BY SIDE- FOR 3 SERIES OF FIGURES | Charts and Charting in Excel | |||
Loop to create charts | Excel Programming | |||
Charts switch from 'Series in Rows' to 'Series in Columns' | Charts and Charting in Excel | |||
Use a loop to create multiple Charts - Suggestions ? | Charts and Charting in Excel |