Hi,
je nachdem für welche Variante du dich letztlich entscheidest einfach Test1 oder Test2 ausführen.
Sub Test1()
Dim lzei As Long, i As Long
lzei = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lzei
If Cells(i, 1).Value Like "##.##. ##.##.*" Then
zei = i: spa = 1
Else
spa = spa + 1
Cells(zei, spa) = Cells(i, 1)
Cells(i, 1).EntireRow.Delete
i = i - 1: lzei = lzei - 1
End If
If i = lzei Then Exit For
Next i
End Sub
Sub Test2()
Dim lzei As Long, i As Long
lzei = Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lzei
If Cells(i, 1).Value Like "##.##. ##.##.*" Then
zei = i
Else
Cells(zei, 1) = Cells(zei, 1) & Cells(i, 1)
Cells(i, 1).EntireRow.Delete
i = i - 1: lzei = lzei - 1
End If
If i = lzei Then Exit For
Next i
End Sub
Gruß Mr. K.
|