Originally Posted by
Admin
Here is an UDF to find the nth Largest unique value from an array.
Function NTHLARGESTUNIQUE(ByRef InpData, Optional ByVal Nth As Long = 1)
Dim i As Long, UB1 As Long, UB2 As Long
NTHLARGESTUNIQUE = CVErr(xlErrNum)
If TypeOf InpData Is Range Then
If InpData.Rows.Count > 1 And InpData.Columns.Count = 1 Then
InpData = Application.Transpose(InpData.Value2)
ElseIf InpData.Rows.Count = 1 And InpData.Columns.Count > 1 Then
InpData = Application.Transpose(Application.Transpose(InpDat a.Value2))
Else
Exit Function
End If
End If
....
.... < snip >
....
Bookmarks