Where is the problem???

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
Back
Top