Gruppe
Allgemein
Problem
Der Wert in Zelle A1 soll nach Zeilenumbrüchen aufgeteilt werden.
StandardModule: Modul1
Sub SplitText()
Dim vText As Variant
Dim iCounter As Integer
vText = Split(Range("A1").Value, vbLf)
If Left(Application.Version, 1) <> "8" Then
For iCounter = 0 To UBound(vText)
Cells(iCounter + 1, 1).Value = vText(iCounter)
Next iCounter
Else
vText = Range("A1").Value
Do While InStr(vText, vbLf)
iCounter = iCounter + 1
Cells(iCounter, 1).Value = Left(vText, InStr(vText, vbLf) - 1)
vText = Right(vText, Len(vText) - InStr(vText, vbLf))
Loop
Cells(iCounter + 1, 1).Value = vText
End If
End Sub