LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default VLookup question in a macro

Why does an Excel macro stop when a VLookup can't find an
exact match? I would expect it to return N/A in my
variant, but it doesn't. Instead it returns a Run-time
error 1004: Unable to get the VLookup property of the
WorksheetFunction class.

Sample Code:
v = WorksheetFunction.VLookup(r1.Value, ProducerTable, 1,
False)

r1.Value contains producer codes like 61148. I want to
know if that code is in "ProducerTable" which is a one
column range of the valid producer codes.

I was then going to check for ISNA(v) to see if it worked.

OR is there a better way of verifying codes from a range??

THANK YOU!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 Macro/VB Question DDE Question MadDog22 Excel Worksheet Functions 1 March 10th 10 01:47 AM
VLOOKUP question Raz Excel Worksheet Functions 5 February 18th 09 09:51 PM
Vlookup question Daniel Excel Worksheet Functions 9 August 26th 08 01:50 PM
Vlookup question AG Excel Worksheet Functions 2 May 15th 08 01:45 AM
Vlookup question ingleg Excel Discussion (Misc queries) 3 March 31st 06 03:56 PM


All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"