LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
KR KR is offline
external usenet poster
 
Posts: 121
Default Match function, N/A error, how do I get around it?

In XL 2003 VBA, I am using the [application.worksheetfunction] Match
function to identify the position of a variable within another array. I am
requiring an exact match.

I just had my first instance where the match was not found anywhere, and per
the help file:

a.. If MATCH is unsuccessful in finding a match, it returns the #N/A error
value.

So in my code I tried to get around this with an If statement:

If IsError (my match statement) then
'do nothing
Else
'here is all my old code
End if

but it isn't catching the #N/A as an error, and I don't see any similar
operators (?) that would catch the #N/A.

Is there something else I can use? I don't want to use a generic "on error
resume next" for the whole procedure, because I want to catch any other
errors that might occur. I also have to make sure the rest of my code
_doesn't_ run if the match isn't found, otherwise it will cause all sorts of
other errors.

I welcome and appreciate any advice or solutions you might have,
Keith

--
The enclosed questions or comments are entirely mine and don't represent the
thoughts, views, or policy of my employer. Any errors or omissions are my
own.


 
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
how can we get unique values in match function for same match key. Xcel[_2_] Excel Worksheet Functions 11 December 7th 07 08:13 PM
Worksheet function match - run time error Sajit Excel Worksheet Functions 3 July 8th 07 10:30 PM
index match array function-returning only first match, need last. Julie Olsen Excel Worksheet Functions 3 December 29th 06 12:50 AM
Match Function - no room for error Dee Veloper Excel Worksheet Functions 0 January 28th 05 11:58 PM
Error Return Value from and INDEX(A:2,MATCH()) function BJ Excel Worksheet Functions 4 January 26th 05 02:59 PM


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