Fill Array with non-continuous ranges

Jape

New Member
Joined
Sep 30, 2004
Messages
47
Hi, so ive found out the hard way the disadvamtage of not properly placed data. The problem is i have data coming in of wich certain columns do NOT need to be put in a chart. The charts are dynamic and update according to the length(timescale) and type(categorie/dataserie) the user has selected.

Im fairly new to charts and ive made four charts that represent the four different types the user chooses, now i need to add the dataseries to it trough VBA. I know you can pass an array directly to a dataseries, BUT the problem is i have a dynamic range(Timescale in rows) AND a non continous datarange(Categorys as columns) i need to put in the chart.

In an attempt to simplifiy the code for this(instead of a lot of code to pick each column and find out the number of rows to incorporate) i was thinking of the following:


===============================================
Categorys -> Array(1to3) as range with the last row selected --> (for ex. B6500.end(xlup), D6500.end(xlup),H6500.end(xlup)

Timescale1 -> Ts = -1(for rowoffset)
Timescale20 -> Ts20 (1 to 20) = -1 to -20(for rowoffset)
Timescale50 -> Ts20 (1 to 50) = -1 to -50(for rowoffset)
===============================================

I know from there how to populate the dataseries, but i cant figure out how to do the array for the non-continuous columns. Would this be the best solution and if yes how do i populate that array.

Jape,
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,171,826
Messages
5,877,767
Members
433,285
Latest member
iAbdullah

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
Top