Undefined unction when using VLOOKUP

  • Thread starter Thread starter cici
  • Start date Start date
C

cici

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
 
cici said:
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 *
 
cici said:
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
 
Back
Top