Arrays

J

JAmes L

Hello

I have a an array called myarray(50) in vb

I am feeding numbers from a table into the array through a loop. How do i then get the highest number out of the array

Thanks in advance
James
 
P

Pete McCosh

James,

application.worksheetfunction.Max(myarray)

Cheers, Pete.
-----Original Message-----
Hello,

I have a an array called myarray(50) in vba

I am feeding numbers from a table into the array through
a loop. How do i then get the highest number out of the
array?
 
F

Frank Kabel

Hi
AFAIK there's no build-in function for this. So you have
to loop through your array. One workaround could be to put
your array into a (hidden) worksheet range and use the
application.worksheetfunction.max function on this range
-----Original Message-----
Hello,

I have a an array called myarray(50) in vba

I am feeding numbers from a table into the array through
a loop. How do i then get the highest number out of the
array?
 
L

Leo Heuser

Hello James

Maxvalue = Application.WorksheetFunction.Max(myarray)

will do the trick.


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

JAmes L said:
Hello,

I have a an array called myarray(50) in vba

I am feeding numbers from a table into the array through a loop. How do i
then get the highest number out of the array?
 
Top