title: Create empty lists and then append elements to that list
body: <p>I have code in Python that I'm trying to convert to VBA. </p>
  
  <pre><code>List = [] 
  
  For x in range:
      if x not in list:
      list.append(x)
  </code></pre>
  
  <p>I would create an empty list, the Python code would loop through my desired data (defined here as "range") then check if the element was in the list, and if it wasn't, add it. </p>
  
  <p>I am trying to do the same in VBA. It needs to go down one column, and add unique elements in that column to a VBA list.</p>
  
  <p>Based on searching I have this: </p>
  
  <pre><code>Dim list() As Variant
  
  For n = 1 To end
     If list.Contains(Cells(n,1).value) Then 
         list(n) = Cells(n,1).value 
         n= n+1 
  </code></pre>
  
  <p>When I run this code, I get an error where it highlights the "list" in </p>
  
  <pre><code>If list.Contains(Cells(n,1).value) Then
  </code></pre>
  
  <p>and says</p>
  
  <blockquote>
    <p>"Invalid qualifier".</p>
  </blockquote>
  
  <p>I tried changing it to </p>
  
  <pre><code>if list.Contains(Cells(n,1).value) = True
  </code></pre>
  
  <p>to add a qualifier. </p>
  
  <p>All I need to do is create a list of strings. Is there a better way to do this in VBA?</p>