C
Charles
Hello
I must be a complete Idiot but I never managed to get VBA to work with
Excel Charts. Would anyone be kind enought to show me what syntax
works with charts? I must say the "Record Macro" function doesn't
really help to generate clean codes.
Let's say I have several charts on a sheet. I would like to add a new
series to an existing XY chart (chart #2 and I don't know how many
series there are already in this chart).
So my code would start with:
Dim S as worksheet
Set S=Thisworkbook.Sheets("NameoftheSheet")
Dim Rg1 as range, Rg2 as range, Rg3 as range
Set Rg1=S.Range("TheXdata")
Set Rg2=S.Range("TheYdata")
Set Rg3=S.Range("TheChartTitle")
Would anyone be able to indicate me how to do it properly?
The "record macro" function only generates relative references to the
data. Is this the only solution (I have range names)? Does it have to
be a string or can it be a range, etc.
I thank you in advance
Charles
I must be a complete Idiot but I never managed to get VBA to work with
Excel Charts. Would anyone be kind enought to show me what syntax
works with charts? I must say the "Record Macro" function doesn't
really help to generate clean codes.
Let's say I have several charts on a sheet. I would like to add a new
series to an existing XY chart (chart #2 and I don't know how many
series there are already in this chart).
So my code would start with:
Dim S as worksheet
Set S=Thisworkbook.Sheets("NameoftheSheet")
Dim Rg1 as range, Rg2 as range, Rg3 as range
Set Rg1=S.Range("TheXdata")
Set Rg2=S.Range("TheYdata")
Set Rg3=S.Range("TheChartTitle")
Would anyone be able to indicate me how to do it properly?
The "record macro" function only generates relative references to the
data. Is this the only solution (I have range names)? Does it have to
be a string or can it be a range, etc.
I thank you in advance
Charles