For a start, you probably want to set min
and max
after you have entered the first element of the array.
For example, you currently set min
to 1
since that's the first element in the array before you start data entry.
If you then enter five values all greater than a hundred, min
will remain as 1
despite the fact you didn't enter it.
You're probably looking for something like:
Dim arr(4) As Integer // 0-4 inclusive (from memory)
Dim max As Integer
Dim min As Integer
arr(0) = InputBox("Enter 1st Value")
arr(1) = InputBox("Enter 2nd Value")
arr(2) = InputBox("Enter 3rd Value")
arr(3) = InputBox("Enter 4th Value")
arr(4) = InputBox("Enter 5th Value")
max = arr(0)
min = arr(0)
For ...