sorting an array

Fire_Chief

Well-known Member
Joined
Jun 21, 2003
Messages
690
Office Version
  1. 365
Platform
  1. Windows
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

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Marty

Why not just use Application.Max(NUMBERS)?
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0
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 ?
 
Upvote 0
They are not combined.
But
I found a way to do it

Thank you for your help
 
Upvote 0

Forum statistics

Threads
1,214,925
Messages
6,122,298
Members
449,077
Latest member
Rkmenon

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
Back
Top