Gruppe
Allgemein
Problem
Eine Zeichenfolge soll gemäß den enthaltenen Zeilenumbrüchen in mehrere Zellen aufgeteilt werden.
StandardModule: Modul1
Sub Aufteilen()
Dim iRow As Integer
Dim sTxt As String
Range("A1").Select
sTxt = ActiveCell.Value
Do While InStr(sTxt, vbLf)
ActiveCell.Offset(iRow, 1).Value = _
Left(sTxt, InStr(sTxt, vbLf) - 1)
sTxt = Right(sTxt, Len(sTxt) - InStr(sTxt, vbLf))
iRow = iRow + 1
Loop
ActiveCell.Offset(iRow, 1).Value = sTxt
End Sub