View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Need a way to verify a string is present in 1-column array?

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



TAN wrote:

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!


--

Dave Peterson