Arrays

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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?
 
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?
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top