question on arrays in vba

K

Keyur

hi

i am building an array (arr(n)) of values of n cells in a macro/

i want to check if a cell's (other than those n) value is in thi
array.

is it possible to do it in one step, like

if cells(1,1).value = arr(1 to n) then


Thanks for any hel
 
J

Juan Pablo González

Yes, try this

If IsNumeric(Application.Match(Cells(1, 1).Value, Arr, 0)) Then
'is in the array
End If
 
Top