Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I get date/time to wrap (format - wrap text doesn't work)? | Excel Discussion (Misc queries) | |||
Excel 2007; even though "Wrap Text" is on the text does wrap? | Excel Discussion (Misc queries) | |||
Wrap text doesn't wrap | Excel Worksheet Functions | |||
Why won't text in cell wrap. Cell format set to wrap. | Excel Discussion (Misc queries) | |||
Text not continuing to wrap for large block of text in Excel cell | Charts and Charting in Excel |