Sub test
Dim first As Long
Dim second As Long
Dim third As Long
Dim fourth As Long
Dim fifth As Long
Dim firstlocval, secondlocval, thirdlocval, fourthlocval, fifthlocval As Range
Dim firstloc, secondloc, thirdloc, fourthloc, fifthloc As Range
Set rng = Range("Y32:Y57")
first = CLng(WorksheetFunction.Max(Range("Y32:Y57")))
Set firstloc = Range("Y32:Y57").Find(first, , xlValues, xlWhole, xlByRows, xlNext, False)
Set firstlocval = firstloc.Offset(0, -2)
For Each cell In rng
If cell.Value > second And cell.Value < first Then second = cell.Value
Set secondloc = Range("Y32:Y57").Find(second, , xlValues, xlWhole, xlByRows, xlNext, False)
Set secondlocval = secondloc.Offset(0, -2)
If cell.Value > third And cell.Value < second Then third = cell.Value
Set thirdloc = Range("Y32:Y57").Find(third, , xlValues, xlWhole, xlByRows, xlNext, False)
Set thirdlocval = thirdloc.Offset(0, -2)
If cell.Value > fourth And cell.Value < third Then fourth = cell.Value
Set fourthloc = Range("Y32:Y57").Find(fourth, , xlValues, xlWhole, xlByRows, xlNext, False)
Set fourthlocval = fourthloc.Offset(0, -2)
If cell.Value > fifth And cell.Value < fourth Then fifth = cell.Value
Set fifthloc = Range("Y32:Y57").Find(fifth, , xlValues, xlWhole, xlByRows, xlNext, False)
Set fifthlocval = fifthloc.Offset(0, -2)
Next cell
MsgBox firstlocval & "," & secondlocval & "," & thirdlocval & "," & fourthlocval & "," & fifthlocval
End Sub
Bookmarks