ActiveSheet.Shapes.AddChart.Select 'Visualisierung
 With ActiveChart
 .ChartArea.Width = 200
 .ChartArea.Height = 200
 .ChartArea.Top = 140
 .ChartType = xlXYScatterLinesNoMarkers
 .SetSourceData Source:=Union(Range("A5:B" + CStr(lz + 1)), Range("f5:f6")), PlotBy:=xlColumns
 .SetElement (msoElementPrimaryValueGridLinesNone)
 .SetElement (msoElementLegendNone)
 .SeriesCollection(1).MarkerStyle = 0
 .SeriesCollection(2).MarkerStyle = 2
 .SeriesCollection(2).Select
 .SeriesCollection(2).XValues = "=" + ActiveSheet.Name + "!$F$5"
 .SeriesCollection(2).Values = "=" + ActiveSheet.Name + "!$F$6"
 a = .Axes(xlCategory).MaximumScale
 b = .Axes(xlValue).MaximumScale
 If a > b Then
     .PlotArea.Width = 250
     .PlotArea.Height = 250 * b / a
 Else
     .PlotArea.Height = 250
     .PlotArea.Width = 250 * a / b
 End If
 End With
 Cells(lz + 1, 1) = ""
 Cells(lz + 1, 2) = ""
 
 
 Holger schrieb am 04.07.2008 18:25:56:
 
 a = 0: sx = 0: sy = 0: lxx = 0: lyy = 0: lxy = 0 'Berechnung
 For i = 0 To lz - 5
 ai = (x(i) * y(i + 1) - x(i + 1) * y(i)) / 2
 a = a + ai
 sx = sx + ai * (y(i) + y(i + 1))
 sy = sy + ai * (x(i) + x(i + 1))
 Next i
 Cells(4, 6) = a 'Querschnittsfläche
 Cells(5, 6) = sy / 3 / a 'x-Komponente des Schwerpunktes
 Cells(6, 6) = sx / 3 / a 'y-Komponente des Schwerpunktes
 For i = 0 To lz - 5
 ai = (x(i) * y(i + 1) - x(i + 1) * y(i)) / 2
 lxx = lxx + ai * (y(i) * y(i) + y(i) * y(i + 1) + y(i + 1) * y(i + 1))
 lyy = lyy + ai * (x(i) * x(i) + x(i) * x(i + 1) + x(i + 1) * x(i + 1))
 lxy = lxy + ai * (x(i) * y(i) + (x(i) * y(i + 1) + x(i + 1) * y(i)) / 2 + x(i + 1) * y(i + 1))
 Next i
 Cells(7, 6) = lxx / 6 - a * Cells(6, 6) ^ 2 'Trägheitsmomente
 Cells(8, 6) = lyy / 6 - a * Cells(5, 6) ^ 2
 Cells(9, 6) = lxy / 6 - a * Cells(5, 6) * Cells(6, 6)
 
 
 
 
 Holger schrieb am 04.07.2008 18:24:31:
 
 Sub querschnitt()
 lz = Range(Cells(Rows.Count, 1), Cells(Rows.Count, 1)).End(xlUp).Row 'letzte Zeile in Sp A
 If lz < 5 Then MsgBox "Keine Werte!": Exit Sub
 
 ReDim x(lz - 4), y(lz - 4) 'Einlesen der Werte
 Cells(lz + 1, 1) = Cells(5, 1)
 Cells(lz + 1, 2) = Cells(5, 2)
 For i = 0 To lz - 4
 x(i) = Cells(i + 5, 1)
 y(i) = Cells(i + 5, 2)
 Next i
 
 
 
      |