title: excel vba - removing duplicates from an array
body: <p>I am trying to remove duplicate elements from an excel array. I imagine I'm not doing this in the most efficient way, and it doesn't seem to be working anyways:</p>
  
  <pre><code>For lrw = 1 To UBound(rcArray)
      For copyIndex = lrw + 1 To .Rows.Count
          If rcArray(copyIndex) = rcArray(lrw) Then
              rcArray(lrw).Delete
          End If
      Next copyIndex
  Next lrw
  </code></pre>
  
  <p>Do I need to reDim the array? Does anyone have a link to some code for this?</p>
  
  <p>Thanks in advance!</p>