Hello,
I have dynamic size of array and i want to find the position array(selected) which contains maximum value.
For example : Array size is 30 i.e Arr(30) and i want to find the position of maximum value among Arr(4), Arr(5) and Arr(6) only (Not all).
The code i tried does not work as intended as it gives position of maximum value of Arr(4), Arr(5) and Arr(6) among all arrays i.e Arr(30).
While I want position of maximum value of Arr(4), Arr(5) and Arr(6) among arrays Arr(4), Arr(5) and Arr(6) only.
Eg: If Arr(5) contains maximum value among Arr(4), Arr(5) and Arr(6) then "5" should be returned
I have dynamic size of array and i want to find the position array(selected) which contains maximum value.
For example : Array size is 30 i.e Arr(30) and i want to find the position of maximum value among Arr(4), Arr(5) and Arr(6) only (Not all).
The code i tried does not work as intended as it gives position of maximum value of Arr(4), Arr(5) and Arr(6) among all arrays i.e Arr(30).
While I want position of maximum value of Arr(4), Arr(5) and Arr(6) among arrays Arr(4), Arr(5) and Arr(6) only.
Eg: If Arr(5) contains maximum value among Arr(4), Arr(5) and Arr(6) then "5" should be returned
VBA Code:
Sub posi()
Dim position As Long
position = WorksheetFunction.Match(WorksheetFunction.Max(Arr(1),Arr(2),Arr(3)), Arr(), 0)
End Sub