Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Autofit in cells with multiple lines of wrapped text.

I have seen a lot posted about this but 99% of the discussion goes into
merged cells. I am not using merged cells.

What I am attempting to do is put error messages (that are short sentences
seperated with the CHAR(10) to force where I want the line to break.) from
code I am building a formula...

="SiteID must be numeric."&char(10)&"ItemPrice must be currency."

Which I want to put the result in 2(or more depending on how many error
messages are required) lines in the cell. But Autofit seems to randomly pick
where it wants to break the line which make the cell 3-7 lines in height.

How do I force the cells to autosize and properly break the lines where I
specify?

* Is there some way to calculate the required cell width of the longest
sentence in the column of cells? Perhaps I could force the column width =
to that value then. Of course that would require knowing the font size and
how much space is needed for the porportional font's characters.
* Is there some character (not a space or special character) that would
mimic a space in the text for calculating size then doing a replace on that
character back to a space after the column width is set. (special characters
seem to have a higher probability of causing a line break)
* Is there some trick to using autofit that I am missing?


--
Regards,
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Autofit in cells with multiple lines of wrapped text.

Just saw a post from Dave Peterson that suggested to widen the column to 255,
then autofit...
that worked exactly like I want.
--
Regards,
John


"John Keith" wrote:

I have seen a lot posted about this but 99% of the discussion goes into
merged cells. I am not using merged cells.

What I am attempting to do is put error messages (that are short sentences
seperated with the CHAR(10) to force where I want the line to break.) from
code I am building a formula...

="SiteID must be numeric."&char(10)&"ItemPrice must be currency."

Which I want to put the result in 2(or more depending on how many error
messages are required) lines in the cell. But Autofit seems to randomly pick
where it wants to break the line which make the cell 3-7 lines in height.

How do I force the cells to autosize and properly break the lines where I
specify?

* Is there some way to calculate the required cell width of the longest
sentence in the column of cells? Perhaps I could force the column width =
to that value then. Of course that would require knowing the font size and
how much space is needed for the porportional font's characters.
* Is there some character (not a space or special character) that would
mimic a space in the text for calculating size then doing a replace on that
character back to a space after the column width is set. (special characters
seem to have a higher probability of causing a line break)
* Is there some trick to using autofit that I am missing?


--
Regards,
John

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Autofit in cells with multiple lines of wrapped text.

But it didn't work for that other poster (who knows why???).

John Keith wrote:

Just saw a post from Dave Peterson that suggested to widen the column to 255,
then autofit...
that worked exactly like I want.
--
Regards,
John

"John Keith" wrote:

I have seen a lot posted about this but 99% of the discussion goes into
merged cells. I am not using merged cells.

What I am attempting to do is put error messages (that are short sentences
seperated with the CHAR(10) to force where I want the line to break.) from
code I am building a formula...

="SiteID must be numeric."&char(10)&"ItemPrice must be currency."

Which I want to put the result in 2(or more depending on how many error
messages are required) lines in the cell. But Autofit seems to randomly pick
where it wants to break the line which make the cell 3-7 lines in height.

How do I force the cells to autosize and properly break the lines where I
specify?

* Is there some way to calculate the required cell width of the longest
sentence in the column of cells? Perhaps I could force the column width =
to that value then. Of course that would require knowing the font size and
how much space is needed for the porportional font's characters.
* Is there some character (not a space or special character) that would
mimic a space in the text for calculating size then doing a replace on that
character back to a space after the column width is set. (special characters
seem to have a higher probability of causing a line break)
* Is there some trick to using autofit that I am missing?


--
Regards,
John


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Autofit in cells with multiple lines of wrapped text.

Dave, could the other poster have been having issues with a font?

See my post titled: "Autofit Issues" on 2/14/2006 (how do you link these?)

Seems the arial font sometimes does wierd things.

--
Regards,
John


"Dave Peterson" wrote:

But it didn't work for that other poster (who knows why???).

John Keith wrote:

Just saw a post from Dave Peterson that suggested to widen the column to 255,
then autofit...
that worked exactly like I want.
--
Regards,
John

"John Keith" wrote:

I have seen a lot posted about this but 99% of the discussion goes into
merged cells. I am not using merged cells.

What I am attempting to do is put error messages (that are short sentences
seperated with the CHAR(10) to force where I want the line to break.) from
code I am building a formula...

="SiteID must be numeric."&char(10)&"ItemPrice must be currency."

Which I want to put the result in 2(or more depending on how many error
messages are required) lines in the cell. But Autofit seems to randomly pick
where it wants to break the line which make the cell 3-7 lines in height.

How do I force the cells to autosize and properly break the lines where I
specify?

* Is there some way to calculate the required cell width of the longest
sentence in the column of cells? Perhaps I could force the column width =
to that value then. Of course that would require knowing the font size and
how much space is needed for the porportional font's characters.
* Is there some character (not a space or special character) that would
mimic a space in the text for calculating size then doing a replace on that
character back to a space after the column width is set. (special characters
seem to have a higher probability of causing a line break)
* Is there some trick to using autofit that I am missing?


--
Regards,
John


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Autofit in cells with multiple lines of wrapped text.

I don't have a guess to whether it's font related.

And from the lack of responses to your other post, it looks like no one has seen
this or knows the answer.

John Keith wrote:

Dave, could the other poster have been having issues with a font?

See my post titled: "Autofit Issues" on 2/14/2006 (how do you link these?)

Seems the arial font sometimes does wierd things.

--
Regards,
John

"Dave Peterson" wrote:

But it didn't work for that other poster (who knows why???).

John Keith wrote:

Just saw a post from Dave Peterson that suggested to widen the column to 255,
then autofit...
that worked exactly like I want.
--
Regards,
John

"John Keith" wrote:

I have seen a lot posted about this but 99% of the discussion goes into
merged cells. I am not using merged cells.

What I am attempting to do is put error messages (that are short sentences
seperated with the CHAR(10) to force where I want the line to break.) from
code I am building a formula...

="SiteID must be numeric."&char(10)&"ItemPrice must be currency."

Which I want to put the result in 2(or more depending on how many error
messages are required) lines in the cell. But Autofit seems to randomly pick
where it wants to break the line which make the cell 3-7 lines in height.

How do I force the cells to autosize and properly break the lines where I
specify?

* Is there some way to calculate the required cell width of the longest
sentence in the column of cells? Perhaps I could force the column width =
to that value then. Of course that would require knowing the font size and
how much space is needed for the porportional font's characters.
* Is there some character (not a space or special character) that would
mimic a space in the text for calculating size then doing a replace on that
character back to a space after the column width is set. (special characters
seem to have a higher probability of causing a line break)
* Is there some trick to using autofit that I am missing?


--
Regards,
John


--

Dave Peterson


--

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 to split wrapped text in a single cell into multiple lines Dr Fumanchu Excel Discussion (Misc queries) 2 February 27th 08 01:30 PM
autofit row text (wrapped) without changing column width? kimdnw Excel Discussion (Misc queries) 6 August 17th 07 03:15 AM
Autofit Column Headers with wrapped text (Not a merged cell issue) Mark Excel Programming 0 September 13th 05 12:42 AM
Autofit merged cells with wrapped text Dave Peterson[_3_] Excel Programming 2 December 3rd 04 03:35 AM
Autofit merged cells with wrapped text Ivan Excel Programming 0 June 23rd 04 02:33 PM


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