Hi,
Be careful when applying the WorksheetFunction.Max to an array with more than 65536 elements.
I don't know where (if) it is explicitly documented, but it appears that the maximum number of elements in any one dimension that can handle the worksheetfunction operators is the number of rows -- the entire column.
Try the following with various numbers...<pre>Sub test()
Dim MyArr, x
ReDim MyArr(1 To 75000)
For x = 1 To 75000
MyArr(x) = x
Next x
MsgBox Application.Max(MyArr)
End Sub</pre>
If you do have a large data set, either redim the array for two or more dimensions or test in a loop.
_________________
Bye,
Jay
This message was edited by Jay Petrulis on 2002-12-27 11:28