Hey duyane,
If you decrease the EndPtr instead of increase it you could keep the line length under 50 and still word break.
Sub LineBreak2()
Dim StartPtr As Double
Dim EndPtr As Double
Rows(18).EntireRow.ClearContents
StartPtr = 1
EndPtr = 50
Do Until EndPtr > Len(Cells(1, "A"))
Do Until Mid(Cells(1, "A"), EndPtr, 1) = " "
' Debug.Print Mid(Cells(1, "A"), EndPtr, 1);
EndPtr = EndPtr - 1
Loop
Cells(18, "A") = Cells(18, "A") & Mid(Cells(1, "A"), StartPtr, EndPtr - StartPtr) & vbCrLf
StartPtr = EndPtr + 1
EndPtr = StartPtr + 50
Loop
End Sub
Bookmarks