Option
Explicit
Sub
Zeichen_Trennen()
Dim
Str0
As
String
Dim
LaufZahl
As
Long
Dim
Teil
As
Long
Dim
CurLine
As
Long
Dim
CurCol
As
Long
CurLine = 1
CurCol = 2
With
ActiveSheet
Do
Str0 = .Cells(CurLine, 2)
If
Len(Str0) > 60
Then
Do
For
LaufZahl = 60
To
1
Step
-1
If
Mid(Str0, LaufZahl, 1) =
" "
Then
.Cells(CurLine, CurCol) = Left(Str0, LaufZahl - 1)
Str0 = Right(Str0, Len(Str0) - LaufZahl)
CurCol = CurCol + 1
If
Str0 <>
""
Then
If
Len(Str0) <= 60
Then
.Cells(CurLine, CurCol).
Select
Selection.Columns.Insert xlShiftToRight
.Cells(CurLine, CurCol) = Str0
CurCol = 2
Exit
Do
Else
.Cells(CurLine, CurCol).
Select
Selection.Columns.Insert xlShiftToRight
Exit
For
End
If
End
If
End
If
Next
LaufZahl
Loop
Else
CurLine = CurLine + 1
CurCol = 2
End
If
If
.Cells(CurLine, 2) =
""
Then
Exit
Do
Loop
End
With
End
Sub