diagramm.SetSourceData Worksheet("Tabelle4").Range("Tabelle4!$A:$A;Tabelle4!$B:$B")
Besten Dank für die Hilfe.
Sub DiaErstellen()
Dim lngLetzte As Long
Dim diagramm As Chart
With Worksheets("Tabelle4")
lngLetzte = .Range("A1").End(xlDown).Row
Set diagramm = .ChartObjects.Add(50, 50, 250, 150).Chart
diagramm.ChartType = xlXYScatterLines '
Sub DiaErstellen()
Dim lngLetzte As Long
Dim diagramm As Chart
With Worksheets("Tabelle4")
lngLetzte = .Range("A1").End(xlDown).Row
Set diagramm = .ChartObjects.Add(50, 50, 250, 150).Chart
diagramm.ChartType = xlXYScatterLines '
Sub DiaErstellen()
Dim lngLetzte As Long
Dim diagramm As Chart
Dim varSpalte As Variant
Dim rngBereich As Range
varSpalte = Application.InputBox("Bitte Spaltenbuchstabe eintragen", _
"Spaltenauswahl", , , , , , 2)
If Not IsNumeric(varSpalte) Then
With Worksheets("Tabelle4")
lngLetzte = .Range("A1").End(xlDown).Row
Set rngBereich = Union(.Range(.Cells(1, 1), .Cells(lngLetzte, 1)), _
.Range(.Cells(1, varSpalte), .Cells(lngLetzte, varSpalte)))
Set diagramm = .ChartObjects.Add(50, 50, 250, 150).Chart
diagramm.ChartType = xlXYScatterLines '