Another method is to load an array then just use the worksheet formulas:
Sub Codes()
Dim counter As Long
Dim activecell(9) As Double
Dim vartotal As Double
Dim varhighest As Double
Dim varlowest As Double
Dim varaverage As Double
For counter = 0 To 9
activecell(counter) = Application.InputBox("Please enter 10 numbers", " ", , , , , , 1)
Next counter
vartotal = Application.Sum(activecell)
varhighest = Application.Max(activecell)
varlowest = Application.Min(activecell)
varaverage = Application.Average(activecell)
MsgBox "SumTotal = " & vartotal & vbNewLine & "Average = " & varaverage & vbNewLine & "Highest = " & varhighest & vbNewLine & "Lowest = " & varlowest
End Sub
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…