In Excel for Microsoft 365 on Windows, Alt, H, O, I runs AutoFit Column Width for the selected column or columns. Press the keys in sequence—not all at once—and Excel adjusts each selected column to fit its displayed contents.
What Alt+H,O,I means
This is a sequence of ribbon KeyTips: press Alt to show the KeyTips, H to open the Home tab, O to open the Format menu, and I to choose AutoFit Column Width. The letters are menu-navigation keys, not initials you need to type into a cell. You generally do not hold Alt while pressing the remaining keys.
The command changes column width, not font size, row height, or the contents of cells. It is useful when text is cut off, numbers appear as hash marks because a column is too narrow, or you want several columns sized to their contents without dragging each boundary manually. The shortcut is part of Excel’s Windows desktop ribbon interface.
How to use the shortcut
- Select a cell in the column you want to resize, or select multiple columns or cells that span the columns.
- Press and release
Alt. Excel displays KeyTips over the ribbon. - Press
H, thenO, thenI, one key at a time. - Check the result. If the column is still too wide or narrow for your layout, adjust it manually or use a different sizing method.
If you are editing a cell when you begin, finish or cancel the edit first; otherwise, your keystrokes may be entered as cell content instead of navigating the ribbon. You can also watch the KeyTips as you press each letter. If a KeyTip differs from the sequence shown here, your Excel language, ribbon configuration, or version may use different letters.
What Excel changes when you AutoFit
AutoFit sets a width that accommodates the displayed contents of the selected column. Excel considers what appears in the cells, including the effect of number formats and text formatting, rather than changing the underlying values. A date displayed as a long-form date, for example, can need more room than the same date displayed in a compact format.
Each column is sized separately. If you select columns A through C and run the command, Excel does not make them all the same width; it fits A to its contents, B to its contents, and C to its contents. The result can make a table easier to read, but it may also create uneven widths that are not ideal for a carefully designed report.
AutoFit is not the same as choosing a fixed width. It calculates a suitable width from the current contents, while a manually entered width stays at the chosen measurement until you change it. If new, longer content is added later, the existing width does not necessarily update automatically; run AutoFit again when needed.
Selecting the right columns
Your selection determines which columns Excel resizes. To fit one column, click any cell in it. To fit adjacent columns, select cells across those columns or select their column headings. To fit columns that are not next to each other, select the relevant column headings while holding Ctrl on Windows, then run the sequence.
For a whole worksheet, use the Select All button at the intersection of the row and column headings, or press Ctrl+A when appropriate, and then run AutoFit. Be mindful that fitting every column can make a large worksheet much wider than the screen. It is often more useful to select only the data area or the particular columns where information is visibly clipped.
- One column: select a cell in that column.
- A group of neighboring columns: select the columns or a cell range spanning them.
- Several separate columns: select their headings with
Ctrlheld down. - The entire sheet: select all, then apply AutoFit; review the result because long entries may produce very wide columns.
A practical example
Suppose column A contains employee names, column B contains department names, and column C contains email addresses. Some names fit in the current width, but an address such as alexandria.montgomery@example.com is cut off. Select column C and press Alt, H, O, I. Excel widens C to fit the longest displayed entry in that column. It does not change the widths of A or B unless you include them in the selection.
If you select A:C first, each of those columns is fitted independently. That may be helpful when the data has just been imported, but the long email address could make C occupy a large part of the screen. In that case, you might instead keep a more compact width and turn on text wrapping, or choose a fixed width that suits the worksheet’s purpose. AutoFit is a sizing convenience, not a requirement that every value be visible on one line.
AutoFit, dragging, and fixed widths
There are three common ways to size a column, and they solve slightly different problems:
- AutoFit: choose a width based on current cell contents. Use
Alt, H, O, Iwhen you want Excel to calculate the fit. - Drag the boundary: point to the right edge of a column heading and drag it left or right. This gives direct visual control, but does not calculate a fit.
- Double-click the boundary: double-click the right edge of a column heading to AutoFit that column. If you select multiple columns first, double-clicking a boundary in the selection fits each selected column.
You can also use the ribbon path Home > Format > AutoFit Column Width. To enter a specific measurement rather than fit to contents, use Home > Format > Column Width. A fixed width can be better for dashboards, printed reports, and tables where consistent alignment matters more than showing every long entry on one line.
Common problems and limitations
If a value still looks clipped after AutoFit, first check whether the column is hidden or whether the worksheet is protected. A hidden column stays hidden; fitting its width does not make it visible. On a protected sheet, changing column formatting may be disallowed unless the sheet’s protection settings permit it. You may need to unhide the column or ask the workbook owner to allow formatting.
Merged cells are another common complication. Excel does not reliably AutoFit a column based on the contents of a merged cell. If a heading spans several columns and remains clipped, consider unmerging it, using the Center Across Selection alignment option, adjusting the relevant widths manually, or adding a line break and setting the row height as needed.
For numbers, a display of ##### often means the column is too narrow, so AutoFit may fix it. But hash marks can also appear for other reasons, such as a negative date or time value. Widening the column is a useful first check, not a guaranteed correction for every display issue. Also check whether a custom number format or the value itself is producing an unexpected result.
AutoFit can produce a very wide column when even one cell contains a long sentence, URL, or identifier. Excel has a maximum column width, so extremely long content cannot make a column expand without limit. A practical alternative is to wrap text, shorten or split the content, use a note or comment for supporting detail, or keep the column at a deliberate width and let users view the full entry in the formula bar.
Mac and Excel for the web
Alt, H, O, I is the Windows ribbon sequence and should not be assumed to work the same way on a Mac. In Excel for Mac, use Home > Format > AutoFit Column Width if that command is available in the ribbon, or double-click the right edge of the column heading. The mouse method is also a straightforward option when Mac keyboard mappings or system shortcuts differ.
Excel for the web has a different interface from the Windows desktop app, and browser shortcuts can sometimes take precedence over Excel key sequences. Use the available Format command or double-click a column boundary in the worksheet. If you are following instructions for desktop Excel but do not see the same KeyTips, confirm which Excel app and platform you are using before troubleshooting the workbook itself.
Frequently Asked Questions
Do I press Alt, H, O, and I at the same time?
No. Press and release Alt, then press H, O, and I in sequence. They navigate the ribbon menus to AutoFit Column Width.
Does Alt+H,O,I fit the row height too?
No. It fits column width. On Windows, the related ribbon sequence for AutoFit Row Height is Alt, H, O, A. Row height and column width are separate settings.
Can I AutoFit several columns at once?
Yes. Select the columns or a range spanning them, then run the command. Excel calculates a separate width for each selected column.
Why did AutoFit make one column extremely wide?
Excel sizes the column to accommodate its longest displayed entry, subject to the column-width limit. Look for an unusually long sentence, URL, or identifier, then wrap, shorten, or otherwise manage that content if the resulting width is inconvenient.
Will AutoFit work with merged cells?
Not reliably. Excel does not properly calculate AutoFit width from merged-cell contents. Adjust the column widths manually or use an alternative layout, such as unmerged cells, when a merged heading needs to display fully.
Does the shortcut work in Excel for Mac?
It is the Windows ribbon sequence, so do not rely on it as a Mac shortcut. Use Home > Format > AutoFit Column Width or double-click the column boundary instead.
Related
- How to Find a Z-Score Using Excel Solver Step by Step
- Excel Goal Seek Shortcut: Open It, Set a Target, Solve
- How to Enable Solver in Excel on Windows and Mac
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Word and Excel Keyboard Shortcuts: Essential Keys to KnowFor Microsoft Word and Excel on Windows, the most useful shortcuts to start with are Ctrl+C to copy,…
- How to Add a Drop-Down List in Excel on SharePointTo add a drop-down list to an Excel workbook stored on SharePoint, open the workbook in Excel, select…
- Clear Excel Shortcut: Contents, Formats, and CellsTo clear the contents of selected Excel cells on Windows, select them and press Delete. This removes values…
- Excel Text Box Linked to Cell: Setup, Uses, and FixesYes. In Excel for Microsoft 365 on Windows, select the text box by its outer border, click the…
- Excel Workbook Not Opening? Causes and Fixes for WindowsIf an Excel workbook will not open, first try opening Excel in Safe Mode, then use File >…
- Convert Text to Number in Excel Cells: Quick FixesTo convert text to numbers in Excel, select the affected cells and click the warning icon, then choose…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.