question on arrays in vba

  • Thread starter Thread starter Keyur
  • Start date Start date
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
 
Yes, try this

If IsNumeric(Application.Match(Cells(1, 1).Value, Arr, 0)) Then
'is in the array
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

Back
Top