title: VBA Compare 2 arrays, write unique values to cell with comma delimiter
body: <p>I have a series of 2 cells in which values are separated by a comma delimiter.</p>
  
  <p>Example</p>
  
  <p>Cell D1 = 1,2,3,4,5,6,7,8,9,10</p>
  
  <p>Cell O1 = 1,2,3,4,5,6</p>
  
  <p>I want to first use the split function to pass the values to an Array and subsequently compare those 2 Arrays to find out the unique/not double values. 
  These values then i want to write to another cell as values with a comma delimiter. 
  Based on this answer </p>
  
  <p><a href="https://stackoverflow.com/a/30067221">Comparing two Dimension array</a>
  and something I found about adding values to an Array i tried my luck with this code</p>
  
  <blockquote>
  <pre><code>Sub compare() 
  Dim cont As Long 
  Dim x As Long 
  Dim y As Long 
  Dim Source As Variant 
  Dim Comparison As Variant 
  Dim Target As Variant
  
  With ThisWorkbook.Worksheets("Open items")
  For cont = 1 To .Cells(Rows.Count, 4).End(xlUp).Row
  Source = Split(.Range("D" &amp; cont).Value, ",")
  Comparison = Split(.Range("O" &amp; cont).Value, ",")
  For x = LBound(Source) To UBound(Source)
  For y = LBound(Comparison) To UBound(Comparison)
  If Source(x, y) = !Comparison(x, y) Then
  Target(UBound(Target)) = Source(x, y).Value
  Next
  Next
  
  Next cont
  End Sub
  </code></pre>
  </blockquote>
  
  <p>But seem to be stuck. 
  Is this the correct way to add a value to the Array Target?
  How do I get the Array into the cell?</p>
  
  <p>The result in my example should be for Target to contain "7", "8", "9" , and "10" and should be shown in a cell in the way</p>
  
  <p>7,8,9,10</p>
  
  <p>Thank you for your help!</p>