title: How to find duplicate in the same cell and erase one instance in VBA
body: <p>A separate program that I cannot change adds to a spreadsheet and sometimes it duplicates something. </p>
  
  <p>For example:in cell 5, 3</p>
  
  <p><code>ABC, vbd, S19M-0027757-27760, S19M-0027757-27760(1)</code></p>
  
  <p>or it could be</p>
  
  <pre><code>ABC, vbd S19M-0027757-27760, S19M-0027757-27760(1)
  </code></pre>
  
  <p>What I need to do is replace both of them with S19M-0027757-27760(1) so the out come would be:</p>
  
  <p><code>ABC, vbd, S19M-0027757-27760(1)</code></p>
  
  <p>So far I have:</p>
  
  <pre><code>For i = 5 To lRow
     inputArray = Split(Cells(i, 3).Value, " ")
     For j = 0 To (UBound(inputArray) - LBound(inputArray) - 1)
        Dim firstString As String
        Dim secondString As String
        firstString = inputArray(j)
        secondString = inputArray(j + 1)        
     Next
  Next
  </code></pre>
  
  <p>I am thinking the next step would be to compare letter by letter? But what about the comma and (1)?</p>