title: Get Unique Values Using Advanced Filters Not Working?
body: <p>I have two sheets:</p>
  
  <p>Sheet 2:</p>
  
  <pre><code>Column C
  Supplier Name
  A
  A
  B
  B
  C
  </code></pre>
  
  <p>Sheet 1 (Desired Result)</p>
  
  <pre><code>Column G
  A
  B
  C
  </code></pre>
  
  <p>I am trying to create a list of unique supplier names in column G on Sheet 1, as shown above.</p>
  
  <p>I am using this code:</p>
  
  <pre><code>Sub LIST()
      Dim r1 As Range, r2 As Range
  
      Dim lastrow As Long
      lastrow = Sheets("Data").Cells(Rows.Count, "C").End(xlUp).row
  
      Set r1 = Sheets("Data").Range("C2:C" &amp; lastrow)
      Set r2 = Sheets("Sheet1").Range("G16")
  
      r1.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=r2, unique:=True
  
  
  
  End Sub
  </code></pre>
  
  <p>This code is not working correctly. It shows the first supplier name A as duplicated like so:</p>
  
  <p>Sheet 1</p>
  
  <pre><code>Column G
  A
  A
  B
  C
  </code></pre>