title: Loop through split value cells and replace
body: <p>I have created a macro in Excel. In column A values are separated by a semicolon.</p>
  
  <p>There is a loop through split values in column A replacing split values in column B. </p>
  
  <p>Looping through split values doesn't work. </p>
  
  <pre><code>Sub ReplaceAttachments3()
  Dim cl As Range
  Dim cell As Variant
  Dim i As Long
  Dim txt As String
  For Each cl In Range("$B$1:$B" &amp; Range("$B65536").End(xlUp).Row)
      txt = Cells(cl.Row, 1)
      cell = split(txt, ";")
      For i = 0 To UBound(cell)
          Cells(cl.Row, 2).replace What:=txt,   Replacement:="",LookAt:=xlPart, SearchOrder:= _
              xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
          Application.Goto Reference:="ReplaceAttachments"
      Next i
  Next
  End Sub
  </code></pre>