#1   Report Post  
Sanz
 
Posts: n/a
Default IsNA(match

Hi All

Was wondering if you could help me, I have the following function:

Function NOT_IN(value, range)


NOT_IN = Application.IsNA(Application.Match(1, "C6:j6", 0))

End Function

The Function reads False in the cell no matter what I do, can anyone help??
  #2   Report Post  
Dave Peterson
 
Posts: n/a
Default

I'd use something like:

Option Explicit
Function NOT_IN(myValue As Variant, myRange As Range) As Boolean
NOT_IN = CBool(IsError(Application.Match(myValue, myRange, 0)))
End Function

Tested with:
Sub testme()
MsgBox NOT_IN("asdf", Worksheets("sheet1").Range("a1:A99"))
End Sub

I'd stay away from variables named Value and Range.

Sanz wrote:

Hi All

Was wondering if you could help me, I have the following function:

Function NOT_IN(value, range)


NOT_IN = Application.IsNA(Application.Match(1, "C6:j6", 0))

End Function

The Function reads False in the cell no matter what I do, can anyone help??


--

Dave Peterson
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
IsNA(match Duke Carey Excel Worksheet Functions 0 May 23rd 05 06:10 PM


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