IsNA(match

G

Guest

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??
 
D

Dave Peterson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ISNA Function 4
Copy/paste speed 3
INA help 2
IF, ISNA & VLOOKUP 5
Match based on calculated value 5
VLOOKUP with a Named Range argument 1
ISNA match function help 9
Comparing two columns 13

Top