ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   second biggest in array (https://www.excelbanter.com/excel-programming/387560-second-biggest-array.html)

Arne Hegefors

second biggest in array
 
hi! i have any array with numbers and i want to get the second biggest number
in the array. how can i do this?

Norman Jones

second biggest in array
 
Hi Arne,

Try something like:

'=============
Public Sub Tester()
Dim arr As Variant
Dim Res As Double

arr = Range("A1:A100").Value

Res = Application.Large(arr, 2)
MsgBox Res
End Sub
'<<=============


---
Regards,
Norman


"Arne Hegefors" wrote in message
...
hi! i have any array with numbers and i want to get the second biggest
number
in the array. how can i do this?





All times are GMT +1. The time now is 04:06 PM.

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