Option
Explicit
Private
Sub
xyz()
Dim
Spalte
As
Long
Dim
i
As
Long
Dim
lngEZ
As
Long
Dim
lngLZ
As
Long
Dim
dblOG
As
Double
Dim
dblUG
As
Double
Dim
dblMittelwert
As
Double
Dim
dblStandardabweichung
As
Double
Dim
dblMaximal
As
Double
Dim
dblMinimal
As
Double
Dim
dblSpannweite
As
Double
Dim
dblcm
As
Double
Dim
dblcmo
As
Double
Dim
dblcmu
As
Double
Dim
dblcmk
As
Double
Spalte = Cells(1, Columns.Count).
End
(xlToLeft).Column
Range(Cells(1, Spalte + 1), Cells(1, Spalte + 1)).EntireColumn.Insert
lngEZ = Cells(10, Spalte).
End
(xlDown).Row + 2
lngLZ = Cells(Rows.Count, Spalte).
End
(xlUp).Row
dblOG = Cells(3, Spalte).Value
dblUG = Cells(4, Spalte).Value
dblMittelwert = Application.Average(Range(Cells(lngEZ, Spalte), Cells(lngLZ, Spalte)))
dblStandardabweichung = Application.StDev(Range(Cells(1, Spalte), Cells(lngLZ, Spalte)))
dblMaximal = Application.Max(Range(Cells(lngEZ, Spalte), Cells(lngLZ, Spalte)))
dblMinimal = Application.Min(Range(Cells(lngEZ, Spalte), Cells(lngLZ, Spalte)))
dblSpannweite = dblMaximal - dblMinimal
dblcm = ((dblOG - dblUG) / (6 * dblStandardabweichung))
dblcmo = ((dblOG - dblMittelwert) / (3 * dblStandardabweichung))
dblcmu = ((dblMittelwert - dblUG) / (3 * dblStandardabweichung))
dblcmk = Application.Min(dblcmo, dblcmu)
For
i = 2
To
Spalte
Cells(6, Spalte).Value = dblStandardabweichung
Cells(7, Spalte).Value = dblMaximal
Cells(8, Spalte).Value = dblMinimal
Cells(9, Spalte).Value = dblSpannweite
Cells(10, Spalte).Value = dblcm
Cells(11, Spalte).Value = dblcmk
Next
i
End
Sub