A
Adrian
I have a function in development that is giving me trouble.
The line beginning "lkcol =" works fine.
The line beginning "rtncol =" gives the error message "run
time error 1004, Unable to get the Match property of the
WorksheetFunction class."
Function Minfo(lookupkey, lookupval, rtnkey)
Set rng = Workbooks("data.xls").Worksheets("staff").Range
("1:1")
lkcol = Application.WorksheetFunction.Match(lookupkey,
rng, 0)
rtncol = Application.WorksheetFunction.Match(rtnkey, rng,
0)
MsgBox lkcol & " " & rtncol
' more to go in here
Minfo = 0
End Function
The line beginning "lkcol =" works fine.
The line beginning "rtncol =" gives the error message "run
time error 1004, Unable to get the Match property of the
WorksheetFunction class."
Function Minfo(lookupkey, lookupval, rtnkey)
Set rng = Workbooks("data.xls").Worksheets("staff").Range
("1:1")
lkcol = Application.WorksheetFunction.Match(lookupkey,
rng, 0)
rtncol = Application.WorksheetFunction.Match(rtnkey, rng,
0)
MsgBox lkcol & " " & rtncol
' more to go in here
Minfo = 0
End Function