[COLOR="Blue"]Sub[/COLOR] SplitText()
[COLOR="Blue"]Dim[/COLOR] iLen [COLOR="Blue"]As[/COLOR] [COLOR="Blue"]Integer[/COLOR], s [COLOR="Blue"]As[/COLOR] [COLOR="Blue"]String[/COLOR], i [COLOR="Blue"]As[/COLOR] [COLOR="Blue"]Integer[/COLOR], iShift [COLOR="Blue"]As[/COLOR] [COLOR="Blue"]Integer[/COLOR], j [COLOR="Blue"]As[/COLOR] [COLOR="Blue"]Integer[/COLOR]
iShift = 1
[COLOR="Blue"]With[/COLOR] ActiveCell
[COLOR="Blue"]If[/COLOR] Len(.Value) > 40 [COLOR="Blue"]Then[/COLOR]
iLen = Len(.Value)
[COLOR="Blue"]For[/COLOR] i = 1 [COLOR="Blue"]To[/COLOR] iLen
s = s & Mid(.Value, i, 1)
[COLOR="Blue"]If[/COLOR] i [COLOR="Blue"]Mod[/COLOR] 40 = 0 [COLOR="Blue"]Then[/COLOR]
ActiveCell.Offset(iShift, 0) = s
s = ""
iShift = iShift + 1
[COLOR="Blue"]End[/COLOR] [COLOR="Blue"]If[/COLOR]
[COLOR="Blue"]Next[/COLOR]
[COLOR="Blue"]If[/COLOR] iLen [COLOR="Blue"]Mod[/COLOR] 40 <> 0 [COLOR="Blue"]Then[/COLOR]
j = Fix(iLen / 40)
[COLOR="Blue"]If[/COLOR] j * 40 > iLen [COLOR="Blue"]Then[/COLOR]
.Offset(iShift, 0) = Mid(.Value, j * 40, iLen - j * 40)
[COLOR="Blue"]Else[/COLOR]
.Offset(iShift, 0) = Right(.Value, iLen - 40 * j)
[COLOR="Blue"]End[/COLOR] [COLOR="Blue"]If[/COLOR]
[COLOR="Blue"]End[/COLOR] [COLOR="Blue"]If[/COLOR]
[COLOR="Blue"]End[/COLOR] [COLOR="Blue"]If[/COLOR]
[COLOR="Blue"]End[/COLOR] [COLOR="Blue"]With[/COLOR]
[COLOR="Blue"]End[/COLOR] [COLOR="Blue"]Sub[/COLOR]