Use of Range(Cell1,Cell2) in chart creation
I'm trying to create charts of various data sets using a calculated
dynamic range. However "SetSourceData Source" seems to be limited in
the types of expression it will allow for ranges. For example:
ActiveChart.SetSourceData Source:=Sheets("One").Range("D5:E29')
is OK, but
ActiveChart.SetSourceData Source:=Sheets("One").Range(Cells(5, 4),
Cells(29, 5)),
tells me that "Method 'Cells' of object '_Global' failed".
I need to be able to use the second technique, or some variant of it.
Could someone please suggest a work-around? (BTW,
Sheets("One").Selection , where the selection has been pre-organised,
also seems to be forbidden by VBA. Pity, that would have been an ideal
solution)
TIA
|