View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Rob Bovey Rob Bovey is offline
external usenet poster
 
Posts: 811
Default 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 *