title: Excel VBA How to append column of value to array?
body: <p>I would like to search through a column of data and compare the values. If a value is not in the array, then I want to append the value to the array. Otherwise, I keep looking through each row. I'm having a little trouble with the syntax. Can I get some help?</p>
  
  <p>When I run this I get an error saying "Invalid Procedure call or argument" on the IsError(Application.Match(cells(i, 4).Value, codeArr, False)) function.</p>
  
  <pre><code>For i = 1 To 17381
    If IsError(Application.Match(cells(i, 1).Value, codeArr, False)) Then
  
      ReDim Preserve codeArr(count)
      codeArr(count) = cells(i, 1)
      count = count + 1
    End If
  Next i
  </code></pre>