Dim lngMaxIndex As Long
Dim i As Long
lngMaxIndex = LBound(A)
For i = LBound(A) + 1 To UBound(A)
If A(i) > A(lngMaxIndex) Then
lngMaxIndex = i
End If
Next i
A(lngMaxIndex)就是最大值
Dim lngMaxIndex As Long
Dim i As Long
lngMaxIndex = LBound(A)
For i = LBound(A) + 1 To UBound(A)
If A(i) > A(lngMaxIndex) Then
lngMaxIndex = i
End If
Next i
A(lngMaxIndex)就是最大值