Where is the problem???

G

Guest

Hi,

i'm using this to change chart like this:

ActiveChart.SetSourceData Source:=Sheets("DATEN").Range("" & von & ":" & bis
& "1,A1:A11"), PlotBy:=xlRows

where von and bis are given by user from inputbox
it was working but now it gives me an error 1004. why?

Thanks
Henrich
 
C

Conan Kelly

Henrich,

Is "von" a string variable representing a cell address? Is "bis" as string variable representing a column letter or a cell address?

According to the code you provided, it looks like "von" is a cell address & "bis" is a column letter.

If that is the case, I would change your code from:


ActiveChart.SetSourceData Source:=Sheets("DATEN").Range("" & von & ":" & bis & "1,A1:A11"), PlotBy:=xlRows


to:


ActiveChart.SetSourceData Source:=Sheets("DATEN").Range(von & ":" & bis & "1,A1:A11"), PlotBy:=xlRows


I hope that helps,

Conan Kelly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top