VBA loopable chart range values

hmmm...

Board Regular
Joined
Feb 24, 2003
Messages
104
Hi! I need to create about 50 charts on one worksheet. The data are in columns on another worksheet. On this worksheet in the "B" column are the dates that will be the X values for each chart. In the "D" column are the Y values for the first chart.

I understand that I need to set up a loop that will move one data column to the right each time through. My question is how to format the data range in the subroutine so that I can add to the range. For the date (X vales that don't change) my range statement goes like this; I found this by macro-recording while I built a chart:

ActiveChart.SeriesCollection(1).XValues = "='array wt 2011'!$B$6:$B$118"

And the Y-values (which need to increment by one each time) are stated like this:

ActiveChart.SeriesCollection(1).Values = "='array wt 2011'!$d$6:$d$118"

Maybe I can add 1 to "$d$6:$d$118" with OFFSET?

I have searched around and it seems that some have used R1C1 ranges to do this, but don't I need to change the whole worksheet or workbook over to this format to use it in the subroutine?

Others have used Cell to specify the range.

I haven't been able to get any of these to work. It would be great if someone has advice. Thanks!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Forum statistics

Threads
1,203,350
Messages
6,054,900
Members
444,760
Latest member
TeckTeck

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top