Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Vlookup in VB not returning anything error

Hi, I am trying to get the following working:


If Application.WorksheetFunction.IsNA(Application. _
WorksheetFunction.VLookup(lookUpValue,
myRange, 1, False)) = False Then

I have tested it where it should not be able to find
anything from the vlookup and it causes an error of 1004
unable to get the vlookup property of the worksheet class.

How would I go about getting this to work?

Thanks,
Grant.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Vlookup in VB not returning anything error

dim res as Variant
res = VLookup(lookUpValue,myRange, 1, False)
if not iserror(res) then

' don't use Worksheetfunction

--
Regards,
Tom Ogilvy


"Grant" wrote in message
...
Hi, I am trying to get the following working:


If Application.WorksheetFunction.IsNA(Application. _
WorksheetFunction.VLookup(lookUpValue,
myRange, 1, False)) = False Then

I have tested it where it should not be able to find
anything from the vlookup and it causes an error of 1004
unable to get the vlookup property of the worksheet class.

How would I go about getting this to work?

Thanks,
Grant.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Vlookup in VB not returning anything error

Returns sub or function not defined error.


-----Original Message-----
dim res as Variant
res = VLookup(lookUpValue,myRange, 1, False)
if not iserror(res) then

' don't use Worksheetfunction

--
Regards,
Tom Ogilvy


"Grant" wrote in

message
...
Hi, I am trying to get the following working:


If Application.WorksheetFunction.IsNA(Application. _
WorksheetFunction.VLookup(lookUpValue,
myRange, 1, False)) = False Then

I have tested it where it should not be able to find
anything from the vlookup and it causes an error of

1004
unable to get the vlookup property of the worksheet

class.

How would I go about getting this to work?

Thanks,
Grant.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Vlookup in VB not returning anything error

Hi Grant,

I think there was a typo and Tom intended:

res = Application.VLookup(lookUpValue,myRange, 1, False)


---
Regards,
Norman



"Grant" wrote in message
...
Returns sub or function not defined error.


-----Original Message-----
dim res as Variant
res = VLookup(lookUpValue,myRange, 1, False)
if not iserror(res) then

' don't use Worksheetfunction

--
Regards,
Tom Ogilvy


"Grant" wrote in

message
...
Hi, I am trying to get the following working:


If Application.WorksheetFunction.IsNA(Application. _
WorksheetFunction.VLookup(lookUpValue,
myRange, 1, False)) = False Then

I have tested it where it should not be able to find
anything from the vlookup and it causes an error of

1004
unable to get the vlookup property of the worksheet

class.

How would I go about getting this to work?

Thanks,
Grant.



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Vlookup in VB not returning anything error

That is correct. Thanks for the correction.

--
Regards,
Tom Ogilvy

"Norman Jones" wrote in message
...
Hi Grant,

I think there was a typo and Tom intended:

res = Application.VLookup(lookUpValue,myRange, 1, False)


---
Regards,
Norman



"Grant" wrote in message
...
Returns sub or function not defined error.


-----Original Message-----
dim res as Variant
res = VLookup(lookUpValue,myRange, 1, False)
if not iserror(res) then

' don't use Worksheetfunction

--
Regards,
Tom Ogilvy


"Grant" wrote in

message
...
Hi, I am trying to get the following working:


If Application.WorksheetFunction.IsNA(Application. _
WorksheetFunction.VLookup(lookUpValue,
myRange, 1, False)) = False Then

I have tested it where it should not be able to find
anything from the vlookup and it causes an error of

1004
unable to get the vlookup property of the worksheet

class.

How would I go about getting this to work?

Thanks,
Grant.


.







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Vlookup in VB not returning anything error

my typo - editing your code, I deleted application as well and forgot to
add it back.

res = Application.vlookup(lookUpValue, myRange, 1, False)

--
Regards,
Tom Ogilvy

"Grant" wrote in message
...
Returns sub or function not defined error.


-----Original Message-----
dim res as Variant
res = VLookup(lookUpValue,myRange, 1, False)
if not iserror(res) then

' don't use Worksheetfunction

--
Regards,
Tom Ogilvy


"Grant" wrote in

message
...
Hi, I am trying to get the following working:


If Application.WorksheetFunction.IsNA(Application. _
WorksheetFunction.VLookup(lookUpValue,
myRange, 1, False)) = False Then

I have tested it where it should not be able to find
anything from the vlookup and it causes an error of

1004
unable to get the vlookup property of the worksheet

class.

How would I go about getting this to work?

Thanks,
Grant.



.



Reply
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
Formula returning an error gotroots Excel Worksheet Functions 2 January 4th 10 04:53 PM
VLOOKUP returning a #VALUE! error and I've not idea why! HELP!!! forevertrying Excel Worksheet Functions 18 June 25th 09 03:15 AM
Vlookup Function returning #N/A error for two entries rtjeter Excel Discussion (Misc queries) 2 August 2nd 06 04:58 PM
Formula returning #N/A Error---why??? Excel User Excel Worksheet Functions 4 September 26th 05 02:25 PM
Returning Error from Functions LeninVMS[_4_] Excel Programming 3 April 9th 04 06:27 PM


All times are GMT +1. The time now is 07:44 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"