Unten angeführt findet man eine kleine For-Schleife, mit der man die kleinste und größte Zahl in einer zeile sucht und findet... Natürlich auch mit Durchschnitt (für meine Infoklasse, damit diese es leichter hat zu lernen):
Option Explicit
Public Sub Boxplot()
Dim sx As Byte
Dim klza As Byte
Dim grza As Integer
Dim dw As Integer
klza = 100
dw = 0
For sx = 1 To 6
If Cells (2,1 + sx).Value < klza Then
klza = Cells (2,1 + sx).Value
End If
dw = dw + Cells (2,1 + sx).Value
Next
Cells (4,2).Value = klza
grza = 0
For sx = 1 To 6
If Cells(2,1 + sx).Value > grza Then
grza = Cells (2,1 + sx).Value
End If
Next
Cells(5,2).Value = grza
Cells(6,2).Value = dw/6
End Sub
|