Private Sub
cmdTopSales_Click()
Dim
strSales(4, 1)
As
String
Dim
intRow,
intColumn,
intMax,
intMaxRowIndex
As Integer
For
intRow
= 0
To
4
For
intColumn = 0
To
1
strSales(intRow, intColumn) = Cells(intRow + 2, Chr(65 + intColumn))
Next
intColumn
Next
intRow
intMax = 0
For
intRow
= 0
To
4
If
intMax
<
Val(strSales(intRow, 1))
Then
intMax = Val(strSales(intRow, 1))
intMaxRowIndex = intRow
End If
Next
intRow
MsgBox " Top Sales person is " & strSales(intMaxRowIndex, 0), vbOKOnly,
_
"Top Sales Person"
End Sub |