Assuming text is words separated by blanks:
Dim v As Variant
Dim str1 As String, str2 As String
Dim fstr As Boolean
v = Split(Textstring," ")
str1 = ""
str2 = ""
fstr = True
For i = LBound(v) To UBound(v)
If Len(str1) + Len(v(i)) 30 Then fstr = False
If fstr Then
str1 = str1 + v(i) + " "
Else
str2 = str2 + v(i) + " "
End If
Next i
MsgBox str1 & " / " & str2
"Doug Benjamin" wrote:
What I want to do is split up a cell of about 25-60 characters into two
cells without ending up with words cut in half or duplicated words. I
want the first 30 characters in the first cell and the rest if any in
the second cell. Any Ideas?
--
Doug Benjamin
------------------------------------------------------------------------
Doug Benjamin's Profile: http://www.excelforum.com/member.php...o&userid=33407
View this thread: http://www.excelforum.com/showthread...hreadid=532285