View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] baobob@my-deja.com is offline
external usenet poster
 
Posts: 100
Default How do you find WHERE Excel splits your wrapped string?

I should state what I really want first:

I've got a long sentence in a wrapped cell. (10 to 15 in Sing Sing.
Send money.)

The 2nd & succeeding lines of text must be indented. (I'll gladly
settle for leading spaces.) E.g.:


This is a long string which resides in a single
wrapped cell of that wonderful application which
we all know and love called Lotu--I mean Excel.


Has anyone coded this functionality?

***

If not, then I need an intermediate UDF to return either:

- The string formatted with, say, vbLF(s) demarcating Excel's splits
(based on the width of the cell where the string lives, natch).

- The string position of the first split. (Since I may have to
reiterate the function each time I indent, thereby altering string
length a tad, that's maybe all I need.)

- Cell width translated into even a *semblance* of a number with which
to take a substring. Many threads have been devoted to this--few
seemingly to any avail.

And yes, I've played around a fair amount, futilely, with
GetTextExtentPoint32--with unending thanks to Peter T. See Jan. 2008
thread, "How do you x-late GetTextExtentPoint32's units into the real
world?"

Also see May 2006 thread, "How to determine whether text in cell needs
to be wrapped?". A question that could not be more clearly stated--yet
went unanswered as posed.

So how do you hook into Excel's wrap method?

Thanks much.

***