M
Madiya
I am trying to write a UDF but it does not work.
Here is my simple code, what am I doing wrong?
===================
Public Function PP(rng)
Dim WB As Workbook
Set WB = Workbooks("Code Master.xls")
MsgBox WB.Sheets(1).Range("A10").Value
Set VLRNG = WB.Sheets("SHEET1").Range("B:K")
'PP = Application.WorksheetFunction.VLookup(rng.Value, VLRNG, 4, 0)
'<<<not working
PP = Evaluate(Application.WorksheetFunction.VLookup(rng, VLRNG, 4,
0))'<<<not working
End Function
==================
Pl help.
Regards,
Here is my simple code, what am I doing wrong?
===================
Public Function PP(rng)
Dim WB As Workbook
Set WB = Workbooks("Code Master.xls")
MsgBox WB.Sheets(1).Range("A10").Value
Set VLRNG = WB.Sheets("SHEET1").Range("B:K")
'PP = Application.WorksheetFunction.VLookup(rng.Value, VLRNG, 4, 0)
'<<<not working
PP = Evaluate(Application.WorksheetFunction.VLookup(rng, VLRNG, 4,
0))'<<<not working
End Function
==================
Pl help.
Regards,