Excel Auto Row Height: Complete Guide to AutoFit and Fixing Wrapped Text Rows
Master Excel auto row height with AutoFit, keyboard shortcuts, ✅ VBA macros, and fixes for merged cells, wrapped text, and stubborn rows that won't resize.

To AutoFit row height in Excel, select the rows and choose Home > Format > AutoFit Row Height, or double-click the boundary below a row heading; to fit every row, click Select All first. AutoFit sizes each row to its contents, but Microsoft states it cannot be used on rows or columns that contain merged cells.
Excel auto row height is the feature that resizes a row vertically so every line of wrapped text, every oversized font, and every embedded line break fits inside the visible cell. This guide covers the ribbon, double-click, Key Tips, and VBA methods, using Microsoft's documentation for Microsoft 365, 2024, 2021, 2019, and 2016. For a broader overview, see our guide to row height in Excel.
Most spreadsheet users learn AutoFit by accident. You paste a paragraph into a cell, the text disappears below the cell border, and you start dragging row dividers manually. That approach works for three rows. It collapses when a worksheet holds thousands of customer notes or product descriptions. AutoFit removes the manual drag entirely.
Microsoft lists the default row height as 15 points. When you increase font size, enable Wrap Text, or add manual line breaks (Alt+Enter on Windows), the row may need to grow. AutoFit measures the tallest content in each row and sets the height to match, within the 409-point maximum.
There are five reliable ways to trigger it: the Home ribbon (Format, then AutoFit Row Height), Key Tips for keyboard access, double-clicking the boundary below a row heading, Select All plus double-click for the whole sheet, and VBA's Range.AutoFit method. Merged cells are the main exception, so it pays to know how they behave.
Merged cells break AutoFit: Microsoft states you cannot use AutoFit on a row or column that contains merged cells, and you must set those heights manually through the Format menu. Understanding this saves hours of confused troubleshooting.
This article assumes you are working with multiple rows of text content, possibly imported from CSV, copied from a web page, or typed manually with line breaks. We cover the foundations first, then the edge cases where AutoFit fails and what to do when it does.
Before going further, it is worth practicing core formatting skills with hands-on questions. Free Excel quizzes covering ribbon navigation, row formatting, and cell properties are an effective way to lock in muscle memory.
Excel Row Height by the Numbers

Five Ways to Trigger AutoFit Row Height
Ribbon Method
Key Tips Keyboard Route
Double-Click Border
Select All and Double-Click
VBA Macro
Walking through AutoFit Row Height step by step removes most of the confusion users feel when wrap text behaves unexpectedly. Start by selecting the rows that need resizing. Click a row number in the gray header column on the left, or drag across multiple row numbers to select a contiguous range. Clicking Select All at the top-left corner selects every row, so you can AutoFit the entire sheet in one operation.
With rows selected, go to Home > Cells > Format. Under Cell Size, select AutoFit Row Height. Every selected row resizes to fit its contents, whether that is wrapped text, a large font, or a manual line break.
The Key Tips route reaches the same command from the keyboard. Press Alt to display the Key Tips, then press H to open the Home tab, as Microsoft's own example shows. Follow the letters displayed on screen through Format to AutoFit Row Height. The letters you see are the authoritative sequence for your Excel version.
Double-clicking is the quickest single-row method. Move the cursor to the boundary below the row heading until it changes shape, then double-click, and the row fits its contents. For every row on the worksheet, click Select All and double-click the boundary below one of the row headings.
The Row Height dialog offers a different path. Select rows, go to Home > Format > Row Height, and type a value. That is manual resizing rather than AutoFit, but it is the right tool when you need every row at one identical height, or for merged cells where AutoFit cannot be used.
Knowing which method to choose depends on the situation. Single-row fixes use double-click. Bulk worksheet cleanup uses Select All followed by a double-click or Format, AutoFit Row Height. Repetitive workflows use VBA macros. The result is the same: Excel sizes each row to its content. Practicing core operations like this with structured Excel practice questions builds recall speed.
One subtlety worth knowing: AutoFit applies to rows individually. If row 5 contains four lines of wrapped text and row 6 contains one line, AutoFit gives row 5 a tall height and row 6 a shorter one. If you need uniform row heights across a range, use Row Height (the manual dialog) and enter a single value that accommodates your tallest expected content.
AutoFit Row Height Reference
This table lists the AutoFit facts documented by Microsoft.
| Task | Verified method | Notes |
|---|---|---|
| AutoFit selected rows | Home > Cells > Format > Cell Size > AutoFit Row Height | Excel for Microsoft 365, 2024, 2021, 2019, 2016 |
| AutoFit one row | Double-click the boundary below the row heading | Fits the row to its contents |
| AutoFit every row | Select All, then double-click a row boundary | Microsoft quick tip |
| Set an exact height | Home > Format > Row Height, type points, OK | Manual, not AutoFit |
| Mac exact height | Format menu > Row > Height | Excel for Mac |
| Default height | 15 points | Minimum 0 hides the row |
| Maximum height | 409 points | Excel specifications and limits |
| Merged cells | AutoFit cannot be used | Set the height manually |
| Wrapped text cut off | Apply AutoFit Row Height or set height manually | Wrap Text article |
| VBA | Range.AutoFit on a row or range of rows | Errors on other ranges |

Microsoft Excel Practice Test Questions
Prepare for the Microsoft Excel exam with our free practice test modules. Each quiz covers key topics to help you pass on your first try.
Microsoft Excel Excel Basic and Advance
Microsoft Excel Exam Questions covering Excel Basic and Advance. Master Microsoft Excel Test concepts for certification prep.
Microsoft Excel Excel Formulas
Free Microsoft Excel Practice Test featuring Excel Formulas. Improve your Microsoft Excel Exam score with mock test prep.
Microsoft Excel Excel Functions
Microsoft Excel Mock Exam on Excel Functions. Microsoft Excel Study Guide questions to pass on your first try.
Microsoft Excel Excel MCQ
Microsoft Excel Test Prep for Excel MCQ. Practice Microsoft Excel Quiz questions and boost your score.
Microsoft Excel Excel
Microsoft Excel Questions and Answers on Excel. Free Microsoft Excel practice for exam readiness.
Microsoft Excel Excel Trivia
Microsoft Excel Mock Test covering Excel Trivia. Online Microsoft Excel Test practice with instant feedback.
Microsoft Excel Advanced Data Analysis Tools
Free Microsoft Excel Quiz on Advanced Data Analysis Tools. Microsoft Excel Exam prep questions with detailed explanations.
Microsoft Excel Advanced Formula and Macro...
Microsoft Excel Practice Questions for Advanced Formula and Macro Creation. Build confidence for your Microsoft Excel certification exam.
Microsoft Excel Advanced Formulas and Macros
Microsoft Excel Test Online for Advanced Formulas and Macros. Free practice with instant results and feedback.
Microsoft Excel Basic and Advance Question...
Microsoft Excel Study Material on Basic and Advance Questions and Answers. Prepare effectively with real exam-style questions.
Microsoft Excel Creating and Managing Charts
Free Microsoft Excel Test covering Creating and Managing Charts. Practice and track your Microsoft Excel exam readiness.
Microsoft Excel Data Visualization with Ch...
Microsoft Excel Exam Questions covering Data Visualization with Charts. Master Microsoft Excel Test concepts for certification prep.
Microsoft Excel Formulas and Functions
Free Microsoft Excel Practice Test featuring Formulas and Functions. Improve your Microsoft Excel Exam score with mock test prep.
Microsoft Excel Formulas and Functions App...
Microsoft Excel Mock Exam on Formulas and Functions Application. Microsoft Excel Study Guide questions to pass on your first try.
Microsoft Excel Formulas Questions and Ans...
Microsoft Excel Test Prep for Formulas Questions and Answers. Practice Microsoft Excel Quiz questions and boost your score.
Microsoft Excel Functions Questions and An...
Microsoft Excel Questions and Answers on Functions Questions and Answers. Free Microsoft Excel practice for exam readiness.
Microsoft Excel Managing Data Cells and Ra...
Microsoft Excel Mock Test covering Managing Data Cells and Ranges. Online Microsoft Excel Test practice with instant feedback.
Microsoft Excel Managing Tables and Data
Free Microsoft Excel Quiz on Managing Tables and Data. Microsoft Excel Exam prep questions with detailed explanations.
Microsoft Excel Managing Tables and Table ...
Microsoft Excel Practice Questions for Managing Tables and Table Data. Build confidence for your Microsoft Excel certification exam.
Microsoft Excel Managing Worksheets and Wo...
Microsoft Excel Test Online for Managing Worksheets and Workbooks. Free practice with instant results and feedback.
Microsoft Excel MCQ Questions and Answers
Microsoft Excel Study Material on MCQ Questions and Answers. Prepare effectively with real exam-style questions.
Microsoft Excel Questions and Answers
Free Microsoft Excel Test covering Questions and Answers. Practice and track your Microsoft Excel exam readiness.
AutoFit Row Height on Windows and Mac
Microsoft documents AutoFit Row Height for Excel for Microsoft 365, 2024, 2021, 2019, and 2016. The ribbon path is Home → Cells → Format → Cell Size → AutoFit Row Height. Double-clicking the boundary below a row heading fits a single row, and Select All plus a double-click fits every row.
VBA support is complete on Windows: Rows.AutoFit, Selection.EntireRow.AutoFit, and Range("A1:A100").EntireRow.AutoFit all size rows to their contents. The Range.AutoFit method must be called on a row or range of rows, otherwise Excel raises an error.
AutoFit Row Height: When to Use It and When to Avoid It
- +Resizes rows to fit content without manual dragging
- +Handles wrapped text, line breaks, and large fonts
- +Works on a single row or the whole worksheet with Select All
- +Available via ribbon, double-click, Key Tips, and VBA
- −Cannot be used on rows that contain merged cells
- −Sizes each row separately, so uniform heights need a typed Row Height value
- −Limited by the 409-point maximum row height

Auto Row Height Pre-Flight Checklist
- ✓Confirm Wrap Text is enabled on cells where content should wrap to multiple lines
- ✓Unmerge merged cells or set their heights manually, since AutoFit cannot be used on them
- ✓Select all target rows before triggering AutoFit, not just a single cell
- ✓Check that no exact row height was typed after the last AutoFit
- ✓Confirm the worksheet is not protected against formatting changes
- ✓Re-run AutoFit after you paste or import new content into the range
Combine Select-All with AutoFit for instant whole-sheet cleanup
When AutoFit Row Height refuses to work, the cause is usually one of a few conditions. Merged cells are the most common culprit. Microsoft states that you cannot use AutoFit on a row or column that contains merged cells, and that you must set those heights manually through the Format menu.
Wrap Text is the second thing to check. Microsoft's wrap-text article explains that when wrapped text is not fully visible, you can apply Home > Format > AutoFit Row Height or set the height manually. A cell with Wrap Text off keeps its text on one line, so it never needs a taller row.
Exact heights are the third cause. If someone typed a value in the Row Height dialog, the row keeps that height until you run AutoFit Row Height again or type a new value.
Protection is the fourth. A worksheet protected through Review > Protect Sheet allows only the actions its author ticked, so formatting commands may be unavailable. Unprotect the sheet, run AutoFit, then reapply protection.
Finally, remember the limit: no row can exceed 409 points, so extremely long wrapped content will be cut off even after AutoFit. Widen the column, shorten the text, or reduce the font size. Several practice scenarios for this kind of debugging appear in advanced Excel functions question banks, which help build diagnostic instincts.
VBA opens the door to automation patterns that make AutoFit Row Height feel built-in to your workflow. The simplest macro is one line: Rows.AutoFit applies the Range.AutoFit method to every row on the active worksheet. Open the VBA editor with Alt+F11, insert a new module, paste Sub AutoFitAll() then a line with Cells.EntireRow.AutoFit followed by End Sub, and you have a reusable macro. Microsoft notes the Range object must be a row or range of rows, or a column or range of columns, otherwise the method generates an error.
More precise control comes from targeting specific ranges. Range("A1:A500").EntireRow.AutoFit fits only the first 500 rows. Sheets("Data").Rows.AutoFit fits every row on a sheet named Data, even if it is not the active sheet. For multi-sheet workbooks, a For Each loop over Worksheets can call AutoFit on each sheet.
Event-driven AutoFit is possible too. The Worksheet_Change event fires when cells are edited, and Target.EntireRow.AutoFit inside the handler re-fits the affected row. Test it on a copy first and limit it to specific columns, because an event handler that runs on every change can slow a large worksheet.
Error handling matters in production macros. Chart sheets or other sheets that cannot be resized will raise errors in a Worksheets loop, so wrap AutoFit calls in error handling that logs the sheet and continues. Working through formula-focused practice problems builds intuition for similar defensive patterns in calculation logic.
Practical AutoFit habits develop with repetition. The first habit is running AutoFit immediately after every paste operation. CSV imports, web copy-pastes, and content from email all bring inconsistent formatting, and Select All followed by a double-click on a row boundary fits every row in one step. The second habit is enabling Wrap Text on text-heavy columns before you AutoFit, because AutoFit only has more than one line to measure when text wraps.
Set column widths intentionally before applying AutoFit Row Height. If columns are too narrow, text wraps into more lines than necessary and produces oversized rows. Widen text columns first, enable Wrap Text, then AutoFit Row Height. Microsoft notes that wrapped data adjusts automatically when you change the column width, so the order matters.
Remember the fallback: when you need every row at one identical height, or when merged cells block AutoFit, type an exact value in Home > Format > Row Height instead. Manual heights are fine for fixed-format reports. Use AutoFit for content-driven layouts and let the numbers decide, then save the workbook once the heights look right.
Excel Questions and Answers
About the Author

Business Consultant & Professional Certification Advisor
Wharton School, University of PennsylvaniaKatherine Lee earned her MBA from the Wharton School at the University of Pennsylvania and holds CPA, PHR, and PMP certifications. With a background spanning corporate finance, human resources, and project management, she has coached professionals preparing for CPA, CMA, PHR/SPHR, PMP, and financial services licensing exams.




