I'm new to vba and have trouble with swapping cells through a conditional loop.
I have a table which looks like
and want to transform it (move numeric cells to column b and remove non-numeric values) into
Right now I have the code
Sub Swap()
With ThisWorkbook.Sheets("Sheet1")
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
which works fine until line 9, where it keeps swaping B9 and C9 in an endless loop.
I hope anyone can help me

