Hi all
I am using an udf for index and match commands.
Now, i want the function for specific rows ,columns and range so that i can copy and paste to other cells.
We can do it manually by adding $. But i want the udf to insert automatically.
Kindly help.
Veera
Here is the macro
I am using an udf for index and match commands.
Now, i want the function for specific rows ,columns and range so that i can copy and paste to other cells.
We can do it manually by adding $. But i want the udf to insert automatically.
Kindly help.
Veera
Here is the macro
Code:
Function Test(Xa, Aa, rngTable AsRange)
Dim lngRowMatch As Long
Dim lngColMatch As Long
On Error Goto err_handle
With rngTable
lngRowMatch = Application.WorksheetFunction.Match(Xa, .Columns(1), 0)
lngColMatch = Application.WorksheetFunction.Match(Aa, .Rows(1), 0)
Test = .Cells(lngRowMatch, lngColMatch)
End With
Exit Function
err_handle: Test = CVErr(xlErrRef)
End Function
Last edited by a moderator: