|  
                                             
	Hallo Leute, 
	habe folgendes Problem: Ich habe eine Userform erstellt, in der u.a. ein Diagramm enthalten sein soll. Das Diagramm enthält 2 Datenreihen und wurde über das ChartSpace-Tool erstellt. Dateinreihe 1 des Diagramms soll sich auf die primäre y-Achse beziehen, Datenreihe 2 auf die sekundäre y-Achse. Ich konnte soweit auch alles erstellen, Diagramm, zugehörige Datenreihen, primäre und sekundäre y-Achse. Jedoch übernimmt das Diagramm für beiden y-Achsen immer die zuletzt definierte Skalierung (Hier: min=20, max=60).  
	Kann mir bei diesem Problem jemand weiterhelfen und mir sagen, wie ich die Skalierungen unabhängig voneinander mache und die Datenreiehen der jeweiligen y-Achse zuordne? 
	Vielen Dank schon einmal für Eure Hilfe! 
	Noch eine Anmerkung: Bin kein VBA-Spezialist, komme aber normalerweise ganz gut und für meine Zwecke ausreichend damit zurecht. 
	Grüße 
	  
	Unten der bisherige Code. x, y1 und y2 wurden vorher erstellt. 
	---------------------------- 
	'Erstellen des Diagramms in ChartSpace 
	     
	    'Create a new chart and Dim 
	    Dim chart1 
	    Dim yAxisPrimary 
	    Dim xAxisPrimary 
	     
	    ChartSpace1.Clear 
	    ChartSpace1.Refresh 
	     
	    Set chart1 = ChartSpace1.Charts.Add 
	  
	    'Add a series to the chart with the x-values and y-values 
	    Dim series1 
	    Set series1 = chart1.SeriesCollection.Add 
	    With series1 
	        .Type = 25 
	        .Caption = "Datenreihe 1" 
	        .SetData chDimXValues, -1, x        '-1 --> Daten nicht von externer Quelle 
	        .SetData chDimYValues, -1, y1 
	        .Line.Color = RGB(0, 0, 255) 
	    End With 
	  
	    Dim series2 
	    Set series2 = chart1.SeriesCollection.Add 
	    With series2 
	        .Type = 25 
	        .Caption = "Datenreihe 2" 
	        .SetData chDimXValues, -1, x 
	        .SetData chDimYValues, -1, y2 
	        .Line.Color = RGB(255, 0, 0) 
	    End With 
	     
	    'Definition of y-axis and x-axis ------------------------------- 
	     
	    Set xAxisPrimary = chart1.Axes(1) 
	    Set yAxisPrimary = chart1.Axes(0) 
	     
	    x_max = x(n_cells) 
	     
	    With xAxisPrimary 
	        .Position = chAxisPositionBottom 
	        .Scaling.Minimum = 0 
	        .Scaling.Maximum = x_max + 0.5 
	        .NumberFormat = "0.0" 
	        .HasTitle = True 
	        .Title.Caption = "x-Werte" 
	    End With 
	         
	    With yAxisPrimary 
	        .Position = chAxisPositionLeft 
	        .Scaling.Minimum = 0 
	        .Scaling.Maximum = 10 
	        .HasTitle = True 
	        .Title.Caption = "y1-Werte" 
	        .NumberFormat = "0.0" 
	    End With 
	     
	      'Add another series to the chart with the x-values and y-values 
	      
	     
	    'Add 2nd y-axis -------------------------------------------- 
	    chart1.Axes.Add chart1.Axes(0).Scaling 
	     
	    Dim yAxisSecondary 
	    Set yAxisSecondary = chart1.Axes(2) 
	     
	    With yAxisSecondary 
	        .Position = chAxisPositionRight 
	        .Scaling.Minimum = 20 
	        .Scaling.Maximum = 60 
	        .HasTitle = True 
	        .Title.Caption = "y2-Werte" 
	        .NumberFormat = "0" 
	    End With 
	     
	    'Show the legend at the top of the chart 
	    chart1.HasLegend = True 
	    chart1.Legend.Position = chLegendPositionTop 
	  
	  
     |