ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Undefined unction when using VLOOKUP (https://www.excelbanter.com/excel-programming/290943-undefined-unction-when-using-vlookup.html)

cici

Undefined unction when using VLOOKUP
 
When I try to use VLOOKUP or MATCH in VBA, it tells me
function not defined. I checked the References but did not
know which reference to use. Help! Thanks

Rob Bovey

Undefined unction when using VLOOKUP
 
"cici" wrote in message
...
When I try to use VLOOKUP or MATCH in VBA, it tells me
function not defined. I checked the References but did not
know which reference to use. Help! Thanks


Are you prefixing the names of the functions with Application or
Application.WorksheetFunction?

Application.WorksheetFunction.VLookup

should give you access to all the Excel worksheet functions you can use from
VBA. The syntax above will throw a run-time error if the value is not
located. The following syntax:

Application.Vlookup

will return a Variant error value if the value isn't located.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *




Frank Kabel

Undefined unction when using VLOOKUP
 
cici wrote:
When I try to use VLOOKUP or MATCH in VBA, it tells me
function not defined. I checked the References but did not
know which reference to use. Help! Thanks


Hi
try
ret_value=Application.WorksheetFunction.VLookup(.. .your parameters...)

Frank


All times are GMT +1. The time now is 07:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com