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

  • Thread starter Thread starter TAN
  • Start date Start date
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!
 
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
 
Back
Top