PDA

View Full Version : Chart source data isn't in neighbour cells



circaa
07-31-2006, 07:21 AM
Hi guys

I have a chart on my sheet, depending on the options chosen by the user on a form, the code gets the asked values to draw the graphic from another sheet. Usually you get the values with that line for example :

ActiveChart.SeriesCollection(1).Values = "=sheetname!R10C23:R10C34"


The problem is the values i'm looking for aren't in neighbor cells, so I don't know how to do this. I know there's a way with the columns titles like "A" or "B"...but my sheet has many columns and it would be painful to work with all the "AC" and "DZ" columns by the code...so much easier with the "R10C23" way.

any ideas ?

nitt1995
08-03-2006, 01:57 PM
I am not sure what you are looking for, but you can join non-neighboring ranges with:


Dim r as range
set r = Union(Range1,Range2,....)


Hope that this helps