Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Knowing where text will wrap

I have a long text string (1300 characters). Even with text wrapping
and expanding the cell height, it eventually (at 1200-something
characters) stops wrapping.

I want to be able to tell where the text begins to exceed the cell
width (i.e., stops wrapping), so I can end that cell nicely and put
the rest in subsequent cells. I know how to do the latter.

Is there a way to tell via (VBA) where the text begins to exceed the
cell width?

Thanks, Alan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Knowing where text will wrap

That is a known limitation with Excel. The content can be up to 32K,
but the display is limited to somewhere around 1200. The can sometimes
be extended by putting a few lines breaks in the string (ALT ENTER to
enter a line break) but you probably won't get the full content to
display.

You might try dropping a TextBox control on the worksheet and use the
SelectionChange event to put the content of the active cell into the
TextBox. This is far from ideal, but it might be the only work-around.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Fri, 11 Sep 2009 06:49:26 -0700 (PDT), Alan
wrote:

I have a long text string (1300 characters). Even with text wrapping
and expanding the cell height, it eventually (at 1200-something
characters) stops wrapping.

I want to be able to tell where the text begins to exceed the cell
width (i.e., stops wrapping), so I can end that cell nicely and put
the rest in subsequent cells. I know how to do the latter.

Is there a way to tell via (VBA) where the text begins to exceed the
cell width?

Thanks, Alan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Knowing where text will wrap

Chip,
Is there a way to tell via (VBA) where the text begins to
exceed the cell width?

Alternatively, is there a way to find out where the last word (in
a < 1200 character string) ends, with respect to the right border of
the cell? If so, then I could do a simple fix to the code I have.

Thanks, Alan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Knowing where text will wrap

If you add those alt-enters every 80-100 characters, you'll be able to see lots
more than 1300 characters.

If you don't include those alt-enters, you may be able to look at
len(myCell.text). It showed 1024 in my simple testing, though.

Alan wrote:

I have a long text string (1300 characters). Even with text wrapping
and expanding the cell height, it eventually (at 1200-something
characters) stops wrapping.

I want to be able to tell where the text begins to exceed the cell
width (i.e., stops wrapping), so I can end that cell nicely and put
the rest in subsequent cells. I know how to do the latter.

Is there a way to tell via (VBA) where the text begins to exceed the
cell width?

Thanks, Alan


--

Dave Peterson
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
How do I get date/time to wrap (format - wrap text doesn't work)? Alex Excel Discussion (Misc queries) 3 April 4th 23 02:29 PM
Excel 2007; even though "Wrap Text" is on the text does wrap? Bruce M[_2_] Excel Discussion (Misc queries) 0 December 31st 09 02:58 PM
Wrap text doesn't wrap [email protected] Excel Worksheet Functions 1 March 28th 07 01:58 AM
Why won't text in cell wrap. Cell format set to wrap. DRB Excel Discussion (Misc queries) 2 September 28th 06 08:27 PM
Text not continuing to wrap for large block of text in Excel cell Mandra Charts and Charting in Excel 1 May 15th 06 07:13 PM


All times are GMT +1. The time now is 03:46 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"