Problem with rank function based on a non-worksheet array

B

Bas

Hi all,

It seems impossible to calculate a ranking, based on a non-worksheet
array.
Please check my remark: "This won't work..."

Thanks in advance for any feedback!

- Bas

Here's my code;


Option Explicit

'General variables
Dim co As Byte 'Cut Off
Dim Inputs As Range
Dim UP As Variant
'Etcetera...


Function CR_4_SOMSC_GMDH(Inputs, co) As Variant

Dim CaseRankings As Variant '(97)
Dim BenchMarkRankings As Variant '(97)
UP = WorksheetFunction.Index(Inputs, 0, 1)
'Etcetera...

'Used as temporary Array
CaseRankings = Array(UP, UC, LOS, LCBP, LCAP, LCVP, LCOIP, LCB, LCA,
LCV, LCOI, LPBP, LPAP, LPVP, LPOIP, LPB, LPA, LPV, LPOI, OS, CBP, CAP,
CVP, COIP, CB, CA, CV, COI, PBP, PAP, PVP, POIP, PB, PA, PV_, POI,
HOS, HCBP, HCAP, HCVP, HCOIP, HCB, HCA, HCV, HCOI, HPBP, HPAP, HPVP,
HPOIP, HPB, HPA, HPV, HPOI, HV2, HV5, HV10, IV, VD, PD, A2, B2, B3,
B4, C1, D, E, E7, E8, E9, G, H, J, J1, J4, J5, J6, K, K4, K5, L1, M3,
M4, M5, m6, M7, M8, O, P2, P6, R, R5, R6, R7, S7, T8, V, Y)

UP = WorksheetFunction.Rank (UP, CaseRankings) 'This won't work, but
why? It won't give a error message, but the code quits here while
debugging.

'Etcetera...

'Rest of code

End Function
 
Top