Auto Fit | Keyboard Shortcut | Microsoft Excel

HomeExcel Keyboard ShortcutsAuto Fit | Keyboard Shortcut | Microsoft Excel

In Excel, AutoFit feature is used to resize row height and cell width based on the size of the value in the cells.

As you know, Excel has default rows height and cells width and when the user enters any value whose length is more than the cell width, the value spills over the cells, and to resize the cells based on that value we can use AutoFit.

In the below image you can see the length of the values entered was more than the default size of the cells due to which the values spilled over the cells.

values-spilled-over

Keyboard Shortcut to Use AutoFit in the Excel

keyboard-shortcut-to-autofit-cells-width

AutoFit Cells Width (Columns): Alt → H → O → I

shortcut-to-autofit-row-height

AutoFit Row Height (Rows): Alt → H → O → A

Steps to use AutoFit Cells Width Using Keyboard Shortcut

  1. First, select the single cell or the whole column using the “Ctrl + Spacebar” keys.
    4-select-the-column
  2. Now, simply press “Alt → H → O → I” and the width of your cells will get expand based on the top largest cell value within the column.
    5-cells-after-autofit

Steps to use AutoFit Row height Using Keyboard Shortcut

Let’s assume you have unstructured data where in a column you have some values in wrap text and some are not due to which the row height of the data is not same and to make rows and column AutoFit, follow the below steps:

unstructured-data-in-the-cells
  1. First, select the column and expand the column width manually to a level where all the values can be covered.
    7-expand-the-column-width
  2. After that, simply press “Alt → H → O → A” and you will get the rows’ height adjusted.
    8-rows-height-adjusted-by-autofit

Note: In the above case if you use AutoFit cells shortcut to AutoFit the width of the cell, it will not work properly because AutoFit does not work on wrapped text cells and there might be a possibility of having more larger value in any wrapped text cell, so it is advised to expand the column manually and then use the AutoFit row height shortcut.