You would add a further input variable to the UDF and then pass the additional variable to the UDF from the cell call.
Function pFindRowPos(sText As Variant, rngFind As Range, _
Optional SearchDirection As XlSearchDirection = xlNext, _
Optional SearchOrder As XlSearchOrder = xlByRows) As Long
Dim oRg As Range, lResult As Long
With rngFind
Set oRg = .Find(What:=sText, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=SearchOrder, _
SearchDirection:=SearchDirection, _
MatchCase:=False, SearchFormat:=False)
If Not oRg Is Nothing Then lResult = oRg.Row
pFindRowPos = lResult
Set oRg = Nothing
End With
End Function
called for ex. along lines of:
=pFindRowPos("apple",PDFDump!$1:$1048576)
Bookmarks