Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Adjusting Row Height when Wrapping Text.

# Adjusting Row Height when Wrapping Text

Written by Allen Wyatt (last updated June 1, 2020)
This tip applies to Excel 97, 2000, 2002, and 2003

Matt asked if there is a way to format a merged cell so that when the content of the cell exceeds the width, the row height is automatically adjusted to display the additional lines necessary.

Unfortunately, AutoFit (which Excel uses for row height) doesn't work with merged cells. There are ways around this problem, but none of them are easy or automatic. For this reason, you might consider re-designing your worksheet so that it doesn't use merged cells. If you must use them, then you might try this little trick, assuming the merged cells are in A2:M2:

1. Select a cell that is distinct and apart from your data table. For instance, if your data table is in A2:M45, select a cell such as P55.
2. In the cell, enter the formula =A2. Cell P55 should now contain the same text that was in the merged cells (A2:M2).
3. Make sure that the formatting of cell P55 is the same as the formatting of cells A2:M2. The only formatting that should be different is that cell P55 should not be merged with any other cell in any manner. Make sure, as well, that the cell's Wrap setting is turned on.
4. Calculate the combined width of all the cells that make up the merged cell. For instance, if columns A through M have individual widths of 9, then the combined width would be 117 (9 x 13). Subtract 2 from this sum (117 – 2 = 115).
5. Set the width of column P to the calculated width you determined in step 4. Your text should now be wrapped to multiple lines, and the row height automatically adjusts.
6. Check the row height of row 55 (Format | Row | Height).
7. Manually set the height of row 2 to the same row height you determined in step 6.
8. Delete column P and row 55.

You might wonder why, in step 4, you subtracted 2 from your original calculated width. This is just a "fudge factor" used to force a slightly narrower column width, and therefore slightly different word wrapping. This comes in handy when you are later viewing your worksheet using a different zoom factor or when you are using a different printer driver.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2602) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Adjusting Row Height when Wrapping Text.

##### Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

##### MORE FROM ALLEN

Quickly Dumping Array Contents

Variable arrays are used quite often in macros. If you use an array once in your macro and then need to reuse it for ...

Discover More

Floating Information in a Frozen Row

You can freeze information in rows or columns using one of the built-in features of Excel. As you move up or down in the ...

Discover More

Understanding Variables

Variables are used quite frequently in programming, and VBA programming is no exception. Each variable can have a data ...

Discover More

Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!

Making Squares

Cells in a worksheet defined by the intersection of rows and columns. If you adjust row height and column width just ...

Discover More

Filling a Cell

One way you can format a cell is so that its contents are repeated over and over again for the entire width of the cell. ...

Discover More

Using a Custom Format to Add Dashes

Want some dashes automatically added in values you display in a cell? It may be trickier to develop a custom format than ...

Discover More
##### Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. Youâ€™ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine more than 3?

2015-11-28 05:43:19

Ray Austin

If you leave col P in (hidden if you prefer), then the row heights will automatically adjust whenever the data in A2:M45 changes.

##### This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.