Need a way to verify a string is present in 1-column array?

T

TAN

I need to verify than an operator string (part number) input is valid from a
predetermined listing of "acceptable" part numbers without getting #N/A
error. Help!
 
D

Dave Peterson

Maybe you can use application.match()

Dim res as variant 'could be an error
dim myArr as variant
dim myVal as variant 'could be a number or string

myarr = array(1, 2, "abc", "def")

myval = "abc"
res = application.match(myval,myarr,0)

if iserror(res) then
'not found
else
'was found
end if
 

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

Top