title: VBA - Swapping cells until condition is met
body: <p>I'm new to vba and have trouble with swapping cells through a conditional loop.</p>
  <p>I have a table which looks like</p>
  <p><a href="https://i.stack.imgur.com/LLjuG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LLjuG.png" alt="enter image description here" /></a></p>
  <p>and want to transform it (move numeric cells to column b and remove non-numeric values) into</p>
  <p><a href="https://i.stack.imgur.com/89bCr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/89bCr.png" alt="enter image description here" /></a></p>
  <p>Right now I have the code</p>
  <pre><code>Sub Swap()
  
   With ThisWorkbook.Sheets(&quot;Sheet1&quot;)
       For j = 1 To .Cells(Rows.Count, 1).End(xlUp).Row
           If IsNumeric(.Cells(j, 2)) = False Then
               For k = 2 To .Cells(j, Columns.Count).End(xlToLeft).Columns
                   Do Until IsNumeric(.Cells(j, 2)) = True
                       t = .Cells(j, k)
                       .Cells(j, k) = .Cells(j, k + 1)
                       .Cells(j, k + 1) = t
                   Loop
               Next k
           Else
           End If
       Next j
   End With
  End Sub
  </code></pre>
  <p>which works fine until line 9, where it keeps swaping B9 and C9 in an endless loop.</p>
  <p>I hope anyone can help me</p>