ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Arrays (https://www.excelbanter.com/excel-programming/295764-arrays.html)

JAmes L

Arrays
 
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

Pete McCOsh

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

Thanks in advance,
James
.


Frank Kabel

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

Thanks in advance,
James
.


Leo Heuser[_3_]

Arrays
 
Hello James

Maxvalue = Application.WorksheetFunction.Max(myarray)

will do the trick.


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"JAmes L" skrev i en meddelelse
...
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?

Thanks in advance,
James





All times are GMT +1. The time now is 02:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com