LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Text To Column max 26 characters


With these three examples in a single cell, say A1 & A4 & A7, I have a simple macro to put each char into a individual cell (including spaces).

What I want is a 26 char limit per line, space counts as a char.
In the first line the 26th spot falls in one of the spaces, so a break there is good to put the remaining chars on the next line.

In the second line the 26th char falls between the "YP" so in this case I need to back up to the first available space before "YP" and make the break there.

The third line is less than 26 char so it needs no split, but needs to be included in the final 'each char in an individual cell' caper.

HZG MY AG AGHTO TYMVKTZ. K RHT'M ZGM YIJ; K'A

UYQTZ. XVGT K'A KT PEYTM YP HT HQJKGTRG, HII MVHM

ZGYEZG NQETO

Either of the following capers is fine with me.

1. Run the text to columns code and put the entire line in individual cells (including spaces) then run a "26 char max that does not split a word" code and have the line on two rows now.

2. Split the line as is with a "26 char max that does not split a word" code and then run the text to columns code on those lines to put each char in individual cells.

Finding that proper space to make the line break has me stumped.

Thanks,
Howard
 
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
Can I restrict a text column to a specific number of characters? Irene Threadgold Excel Discussion (Misc queries) 4 November 5th 09 09:31 PM
How to cut off characters in a text column abc[_3_] Excel Discussion (Misc queries) 3 October 12th 09 07:40 PM
Deleting characters in a column of cells -converting to text strin Chris Maddogz Excel Programming 2 June 15th 09 04:10 AM
Function to move text 65 characters to next row in column? Nat1 Excel Worksheet Functions 7 December 13th 06 05:23 PM
want to remove all text characters equal to one character in length from text string [email protected] Excel Worksheet Functions 1 April 18th 05 12:25 AM


All times are GMT +1. The time now is 10:28 PM.

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

About Us

"It's about Microsoft Excel"