Hello, Im trying to sort a group of numbers ascending through an array. It needs to get the numbers and then output them in another part of the sheet. I've tried to do it and it only prints out one of my numbers.
Sub sortyoung()
Dim young(1 To 5) As Single
Dim N As Single
For i = 1 To 5 Step 1
young(i) = Sheet1.Cells(2 + i, 4).Value
iMin = i
For L = (i + 1) To 5 Step 1
If young(L) < young(iMin) Then
iMin = L
End If
Next L
If iMin <> i Then
TEMP = young(i)
young(i) = young(iMin)
young(iMin) = TEMP
End If
Sheet1.Cells(2 + i, 6) = young(i)
Next i
End Sub