ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autofit (https://www.excelbanter.com/excel-programming/434088-autofit.html)

Jess

Autofit
 
My user enter text into a form which (text) is later placed in an excel
sheet. The cell where the text is placed is basically a merged cell of four
cells: A1, B1,C1,D1. If the text length fits into the four cells, all the
text is visible. If the text length does not fit into the four cells, part of
the text is not visible: excel creates another line of text in the same cell;
this line becomes visible if my user increases the height of the row (row1)

How can I fix the above issue? I do not wish my users to be manually
increasing the height of the row to view the whole text

Thanks

Jacob Skaria

Autofit
 
Try

Range("A1:D1").Rows.AutoFit

If this post helps click Yes
---------------
Jacob Skaria


"Jess" wrote:

My user enter text into a form which (text) is later placed in an excel
sheet. The cell where the text is placed is basically a merged cell of four
cells: A1, B1,C1,D1. If the text length fits into the four cells, all the
text is visible. If the text length does not fit into the four cells, part of
the text is not visible: excel creates another line of text in the same cell;
this line becomes visible if my user increases the height of the row (row1)

How can I fix the above issue? I do not wish my users to be manually
increasing the height of the row to view the whole text

Thanks


Gord Dibben

Autofit
 
Merged cells will prevent the row autofitting and must be dealt with through
the use of event code behind the worksheet.

For worksheet event code...............

See google search thread for code by Greg Wilson. Watch out for word wrap
in the URL which all one line.

http://groups.google.com/group/micro...1c160cbeb27874


Gord Dibben MS Excel MVP

On Thu, 24 Sep 2009 11:25:01 -0700, Jess
wrote:

My user enter text into a form which (text) is later placed in an excel
sheet. The cell where the text is placed is basically a merged cell of four
cells: A1, B1,C1,D1. If the text length fits into the four cells, all the
text is visible. If the text length does not fit into the four cells, part of
the text is not visible: excel creates another line of text in the same cell;
this line becomes visible if my user increases the height of the row (row1)

How can I fix the above issue? I do not wish my users to be manually
increasing the height of the row to view the whole text

Thanks




All times are GMT +1. The time now is 01:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com