I am writing a UDF that essential acts as the function LARGE but utilises a dynamic range.
When I run it, it returns Value, but I can't see what the issue is. kRange is a particular Cell on the sheet that contains a range as text e.g. N13:N75; iVal is the cell that contains the nth value that I want to look up. Is there anyone who can tell me what I have missed.
Function GetLarge(kRange As Range, iVal As Range) As Double
'kRange is calculation cell
'iVal is the number
Dim RangeK As String
Dim i As Double
RangeK = kRange.Value
i = iVal.Value
GetLarge = Application.WorksheetFunction.Large(RangeK, i)
End Function
When I run it, it returns Value, but I can't see what the issue is. kRange is a particular Cell on the sheet that contains a range as text e.g. N13:N75; iVal is the cell that contains the nth value that I want to look up. Is there anyone who can tell me what I have missed.
Function GetLarge(kRange As Range, iVal As Range) As Double
'kRange is calculation cell
'iVal is the number
Dim RangeK As String
Dim i As Double
RangeK = kRange.Value
i = iVal.Value
GetLarge = Application.WorksheetFunction.Large(RangeK, i)
End Function