Set Row Height depending on cell content...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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?
 
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.
 
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.
 
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.
 
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.
 
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
 
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
 
Back
Top