View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Splitting text in cells.


With ActiveCell

If Len(.Value) MaxSplitLength Then

MsgBox "Splitting to next cell in row"
.Offset(0, 1).Value = Right$(.Value, Len(.Value) -
MaxSplitLength)
.Value = Left$(.Value, MaxSplitLength)
End If
End With

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Joergen Bondesen" wrote in message
...
Hi NG

I need to split cells with text strings.
Max Splitting length is normally between 20 and 40.
If a words length is greater than 'Max Splitting length', then I want a
warning.
Splitting to next cell in row

example A
"This is a test for splitting a text to max length on 22."
1: This is a test for
2: splitting a text to
3: max length on 22.

example B
"attacks against small_medium_and_large-sized organizations."
1: attacks against
2: small_medium_and_large-sized ** and warning**
3: organizations.


Any suggestion / proposal are welcome.

--

Best regards from
Joergen Bondesen