Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Can I Atomatically Split Cell Contents

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Can I Atomatically Split Cell Contents

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Can I Atomatically Split Cell Contents

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there any way to split contents of a cell into more cells. saravanan Excel Discussion (Misc queries) 2 May 14th 10 10:56 AM
split contents of cell april Excel Discussion (Misc queries) 4 May 28th 09 12:05 AM
VBA to split contents of cell Brennan Excel Discussion (Misc queries) 7 March 15th 08 12:03 AM
Split contents of a cell Rikuk Excel Worksheet Functions 5 March 26th 06 04:03 PM
How to split the contents of a cell between two cells. Colin Hayes Excel Worksheet Functions 4 June 11th 05 01:21 AM


All times are GMT +1. The time now is 10:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"