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: 1
Default vlookup, true false issue


Below is what I've writtem so far:

Sub vlookup()

Dim myrange As Range

Set myrange =
Workbooks("first.xls").Worksheets("sheet1").Range( "list")

fred = Application.WorksheetFunction.vlookup(Range("a1"), myrange, 2,
True)

Range("b1") = fred

End Sub

The contents of "first.xls" has numbers 1 to 10 in column A and letters
a to i in column B.

My issue is if I change the 'true' value to 'false' within the vlookup
function. It works fine until I enter a value that is not in my list, I
get a 'error 1004 unable to get the vlookup property of the
worksheetfunction class' message box come up. I am expecting a '#N/A'
instead.

I'm using excel 2003 with vb 6.3.

Any ideas?


--
pjjclark
------------------------------------------------------------------------
pjjclark's Profile: http://www.excelforum.com/member.php...o&userid=29180
View this thread: http://www.excelforum.com/showthread...hreadid=508959

 
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
What's the best way to toggle between true and false in Excel? Hiall, My excel work involves a lot of toggling between true and false (booleantypes) ... and it's very repetitive... Is there a way to select a bunch ofcells, and press a key short-cu LunaMoon Excel Discussion (Misc queries) 9 July 29th 08 12:28 AM
Search for 2 true arguments and return true or false David Excel Discussion (Misc queries) 3 July 15th 06 10:18 AM
Function to return True/False if all are validated as True by ISNU Tetsuya Oguma Excel Worksheet Functions 2 March 15th 06 10:28 AM
Reverse false and combine with true true value Emmie99 Excel Worksheet Functions 5 August 17th 05 04:38 PM
True Or False, no matter what... it still displays the false statement rocky640[_2_] Excel Programming 2 May 13th 04 04:57 PM


All times are GMT +1. The time now is 11:33 AM.

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

About Us

"It's about Microsoft Excel"