ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Ranking without preset Excel function. (https://www.excelbanter.com/excel-worksheet-functions/162315-ranking-without-preset-excel-function.html)

a.riva@UCL

Ranking without preset Excel function.
 
Hi guys!

An other question for you.


I would like to create a new UDF with VBA which could allow me to
determine the rank of a number within an array.


I know that Excel already has a function (WorksheetFunction.Rank())
that does that. But this function requires the second argument to be
declared as Range. Therefore I cannot use this function in the
context
of UDFs where I use array variables, because if I use an array as the
second argument I get a ByRef error. I do not want to assign my array
to a range on the worksheet, but I simply want to use my array as
reference for the ranking procedure.


How can I re-write the ranking procedure without using the Rank
built-
in function, so that I can use an array as reference?


Thank you very much!!!


Antonio.



All times are GMT +1. The time now is 02:30 AM.

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