DIM LNGMAXINDEX AS Longdim i as long
LNGMAXINDEX = LBound (a)
For i = lbound (a) 1 to Ubound (a) IF a (i)> a (lngmaxindex) Then LngmaxIndex = I end ifxext i
A (LNGMAXINDEX) is the maximum value