Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Set Row Height depending on cell content...

Hi All

I need to set the row height depending on the number of lines of text
contained in a cell. Cells that contain text have wordwrap on - if there is
only 1 line of text in the cell the row height should be 12.75, 2 lines of
text should be 22.50 and so on.

Is it possible to determine how many lines of text are in a cell?

Thanks

Trevor
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Set Row Height depending on cell content...

Are you asking if there is a maximum number of lines that can be entered in a
cell or are you asking if a user can determine the number of lines based on a
fixed column width and a known text length?

"Trevor Williams" wrote:

Hi All

I need to set the row height depending on the number of lines of text
contained in a cell. Cells that contain text have wordwrap on - if there is
only 1 line of text in the cell the row height should be 12.75, 2 lines of
text should be 22.50 and so on.

Is it possible to determine how many lines of text are in a cell?

Thanks

Trevor

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Set Row Height depending on cell content...

I'm asking if it's possible to determine the number of lines of text in a
cell based on a fixed column width, but not a known text length. - infact,
it's one line of text that is wrapped in the cell, so how many times the text
is wrapped... Hope that makes sense.

"JLGWhiz" wrote:

Are you asking if there is a maximum number of lines that can be entered in a
cell or are you asking if a user can determine the number of lines based on a
fixed column width and a known text length?

"Trevor Williams" wrote:

Hi All

I need to set the row height depending on the number of lines of text
contained in a cell. Cells that contain text have wordwrap on - if there is
only 1 line of text in the cell the row height should be 12.75, 2 lines of
text should be 22.50 and so on.

Is it possible to determine how many lines of text are in a cell?

Thanks

Trevor

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Set Row Height depending on cell content...

Why not autofit the row and then make adjustments based on the resulting row
height.

But there is no built in attribute to tell you how many lines are in the
cell.

--
Regards,
Tom Ogilvy


"Trevor Williams" wrote:

I'm asking if it's possible to determine the number of lines of text in a
cell based on a fixed column width, but not a known text length. - infact,
it's one line of text that is wrapped in the cell, so how many times the text
is wrapped... Hope that makes sense.

"JLGWhiz" wrote:

Are you asking if there is a maximum number of lines that can be entered in a
cell or are you asking if a user can determine the number of lines based on a
fixed column width and a known text length?

"Trevor Williams" wrote:

Hi All

I need to set the row height depending on the number of lines of text
contained in a cell. Cells that contain text have wordwrap on - if there is
only 1 line of text in the cell the row height should be 12.75, 2 lines of
text should be 22.50 and so on.

Is it possible to determine how many lines of text are in a cell?

Thanks

Trevor

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Set Row Height depending on cell content...

Hi Tom

I didn't want to use autofit as the rows become to tight to the text (I want
a bit of white space between the text and the border) - but, if there's no
other way I'll have to use it.

Thanks for the response.

Trevor

"Tom Ogilvy" wrote:

Why not autofit the row and then make adjustments based on the resulting row
height.

But there is no built in attribute to tell you how many lines are in the
cell.

--
Regards,
Tom Ogilvy


"Trevor Williams" wrote:

I'm asking if it's possible to determine the number of lines of text in a
cell based on a fixed column width, but not a known text length. - infact,
it's one line of text that is wrapped in the cell, so how many times the text
is wrapped... Hope that makes sense.

"JLGWhiz" wrote:

Are you asking if there is a maximum number of lines that can be entered in a
cell or are you asking if a user can determine the number of lines based on a
fixed column width and a known text length?

"Trevor Williams" wrote:

Hi All

I need to set the row height depending on the number of lines of text
contained in a cell. Cells that contain text have wordwrap on - if there is
only 1 line of text in the cell the row height should be 12.75, 2 lines of
text should be 22.50 and so on.

Is it possible to determine how many lines of text are in a cell?

Thanks

Trevor



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Set Row Height depending on cell content...

I've just re-read your answer and realised what you mean - If, after autofit,
the row is 12.75 and <22.50 then make the row height 22.50...

I think I can do that - thanks again Tom

T

"Tom Ogilvy" wrote:

Why not autofit the row and then make adjustments based on the resulting row
height.

But there is no built in attribute to tell you how many lines are in the
cell.

--
Regards,
Tom Ogilvy


"Trevor Williams" wrote:

I'm asking if it's possible to determine the number of lines of text in a
cell based on a fixed column width, but not a known text length. - infact,
it's one line of text that is wrapped in the cell, so how many times the text
is wrapped... Hope that makes sense.

"JLGWhiz" wrote:

Are you asking if there is a maximum number of lines that can be entered in a
cell or are you asking if a user can determine the number of lines based on a
fixed column width and a known text length?

"Trevor Williams" wrote:

Hi All

I need to set the row height depending on the number of lines of text
contained in a cell. Cells that contain text have wordwrap on - if there is
only 1 line of text in the cell the row height should be 12.75, 2 lines of
text should be 22.50 and so on.

Is it possible to determine how many lines of text are in a cell?

Thanks

Trevor

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Set Row Height depending on cell content...

I don't know if this will help, but these are the limits prior to xl2007.

You can enter a row height of 0 (zero) to 409. If the row height is set to
0, the row is hidden. You can enter a column width of 0 (zero) to 255
characters. If the column width is set to 0, the column is hidden.

Generally speaking, the autofit and word wrap functions should set the width
and heigth to accomodate whatever you enter that are within the above
limitations.

"Trevor Williams" wrote:

Hi All

I need to set the row height depending on the number of lines of text
contained in a cell. Cells that contain text have wordwrap on - if there is
only 1 line of text in the cell the row height should be 12.75, 2 lines of
text should be 22.50 and so on.

Is it possible to determine how many lines of text are in a cell?

Thanks

Trevor

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 181
Default Set Row Height depending on cell content...

Thanks JLGWhiz - I want to specify a row's height in increments of 12.75
depending on how many lines of text already exist in the cell. I don't want
to use 'autofit' as the rows become to narrow for what I'm doing.

"JLGWhiz" wrote:

I don't know if this will help, but these are the limits prior to xl2007.

You can enter a row height of 0 (zero) to 409. If the row height is set to
0, the row is hidden. You can enter a column width of 0 (zero) to 255
characters. If the column width is set to 0, the column is hidden.

Generally speaking, the autofit and word wrap functions should set the width
and heigth to accomodate whatever you enter that are within the above
limitations.

"Trevor Williams" wrote:

Hi All

I need to set the row height depending on the number of lines of text
contained in a cell. Cells that contain text have wordwrap on - if there is
only 1 line of text in the cell the row height should be 12.75, 2 lines of
text should be 22.50 and so on.

Is it possible to determine how many lines of text are in a cell?

Thanks

Trevor

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 copy a row depending on the content of a cell in the row Robert59 Excel Worksheet Functions 2 October 19th 07 06:26 PM
Sum data, depending on cell content Mik Excel Worksheet Functions 6 October 18th 07 04:30 PM
Change colour of cell depending on content blain Excel Programming 9 June 17th 06 01:47 PM
Changing cell colour depending on content?? Simon Lloyd[_768_] Excel Programming 5 June 15th 06 12:48 PM
autowrite a cell depending on another cell's content jose carreno Excel Programming 2 October 1st 03 05:50 PM


All times are GMT +1. The time now is 06:50 AM.

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"