Thread: VLookup in VB?
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default VLookup in VB?

Easily handled,

ans = application.vlookup(....
If Iserror(ans) Then
...

or

On Error
ans = WorksheetFunction.VLookup(...
On Error Resume Next

If IsEmpty(ans) Then
...

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Norie" wrote in
message ...

Take a look at the WorksheetFunction method of the Application object.

It let's you access most worksheet functions in VBA.

By the way using Vlookup in VBA can sometimes be a problem, if errors
are returned by the function VBA won't like it.


--
Norie
------------------------------------------------------------------------
Norie's Profile:

http://www.excelforum.com/member.php...o&userid=19362
View this thread: http://www.excelforum.com/showthread...hreadid=397602