PC Review


Reply
Thread Tools Rate Thread

Can I Atomatically Split Cell Contents

 
 
=?Utf-8?B?TG9uZ1Rlcm1Ob29i?=
Guest
Posts: n/a
 
      16th Apr 2007
I am currently using a workbook to assist in filling out several forms by
using only one input form. My problem is that two of the fields can contain a
lot of text and only the first 1024 will display.

Is there code that will count the characters and, if required, split them
over two cells?

TIA
 
Reply With Quote
 
 
 
 
=?Utf-8?B?R2FyeScncyBTdHVkZW50?=
Guest
Posts: n/a
 
      16th Apr 2007
Say A1 contains a very large volumn of text. This macro:

Sub fracture()
s = Split(Range("a1").Value, " ")
i = 1
t = ""
For j = 0 To UBound(s)
t = t & s(j) & " "
If Len(t) > 1000 Or j = UBound(s) Then
Cells(i, "B").Value = t
t = ""
i = i + 1
End If
Next
End Sub


will take that text and distribute it into B1,B2,B33,..... with about 1000
characters in each cell.
--
Gary''s Student - gsnu200715

 
Reply With Quote
 
=?Utf-8?B?TG9uZ1Rlcm1Ob29i?=
Guest
Posts: n/a
 
      16th Apr 2007
Thanks for this, but it doesn't seem to work. Of course this may be because I
failed to mention that the cell containing the text is a merged cell. Is ther
any way around it?

Just to be sure I'm not altering anything I shouldn't - the text is in E12
(E12:R12 merged) and i need it to drop down to the following rows.

Thanks

"Gary''s Student" wrote:

> Say A1 contains a very large volumn of text. This macro:
>
> Sub fracture()
> s = Split(Range("a1").Value, " ")
> i = 1
> t = ""
> For j = 0 To UBound(s)
> t = t & s(j) & " "
> If Len(t) > 1000 Or j = UBound(s) Then
> Cells(i, "B").Value = t
> t = ""
> i = i + 1
> End If
> Next
> End Sub
>
>
> will take that text and distribute it into B1,B2,B33,..... with about 1000
> characters in each cell.
> --
> Gary''s Student - gsnu200715
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
split contents of cell april Microsoft Excel Misc 8 28th May 2009 12:05 AM
split contents of cell april Microsoft Excel Misc 0 27th May 2009 08:34 PM
split the contents of a cell spunkyjon Microsoft Excel Programming 6 6th Mar 2008 02:38 PM
Split contents of a cell Rikuk Microsoft Excel Worksheet Functions 6 26th Mar 2006 04:03 PM
Split contents of a cell Kagsy Microsoft Excel New Users 3 4th Mar 2004 12:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:54 PM.