sorting an array

Fire_Chief

Well-known Member
Joined
Jun 21, 2003
Messages
640
I have an array I call NUMBERS (X)

I have dim it NUMBERS(100)

After I get all the values in it, which might be as many as 80, I want to find out what the highest number is.

How do I sort them to find this?

Thank You

Marty
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
Marty

Why not just use Application.Max(NUMBERS)?
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hi,

try this
Code:
Sub test()
Dim NUMBERS As Variant

NUMBERS = Array(1, 6, 8, 12, 5, 123, 3)
MsgBox Application.Max(NUMBERS)
End Sub
kind regards,
Erik
 

Fire_Chief

Well-known Member
Joined
Jun 21, 2003
Messages
640

ADVERTISEMENT

Here is the array I have

One of thiese has the highest numer. How do I find it?

For I = 1 to 10

HighNumber(I)

next I


Marty
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Here is the array I have

One of thiese has the highest numer. How do I find it?

For I = 1 to 10

HighNumber(I)

next I


Marty
what did you do with the provided examples ?
how did you try to combine them with the example you are giving ?
 

Forum statistics

Threads
1,136,988
Messages
5,678,970
Members
419,796
Latest member
doctorgresham

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top