7. Adjusting Columns and Rows
To make your datasets more readable, it's often necessary to change column width and row height. Let's do this with a few straightforward keyboard shortcuts.
Useful keyboard shortcuts
ALT + O, C, A: Autofit column width on selected columns
ALT + O, C, W: Manually choose column width
ALT + O, R, A: Autofit row height on selected rows
Right-Mouse button key+ R: Manually choose row height
In the previous lesson, we learned how to add, edit and remove rows and columns from our data set. As a result, we now have a clean set of sales entries, but not necessarily a very readable one. In this lesson, we're going to make our data set more readable by learning how to adjust column width and row height. Our biggest problem is that it's hard to read the column headings because the column widths are too narrow. This is a common problem in Excel and you might often see data sets where a user has manually dragged the width of a column by hovering the mouse between two columns like this, holding the mouse and dragging. A much better way of completing this task is to use the Autofit column command. And of course, we have a shortcut for this: Alt + O + C + A. I'm going to demonstrate this by first undoing the change I made earlier with Ctrl + Z, then navigating to the E column, selecting it with Ctrl + Space Bar, and then performing Alt + O + C + A. And you can see that this automatically extends the column so that the full heading “Order quantity” can be seen. We can even perform Alt + O + C + A on multiple columns at the same time. Let's scroll to column H and select it with Ctrl + Space Bar, and then holding Ctrl and Shift and the left arrow, let's select the remaining columns in the data set.
Then perform Alt + O + C + A, and this autofits all the columns in our data set. Alt + O + C + A is a great time-saving shortcut. When I first access a datasheet, I will always autofit every column before performing any other task.
For large data sets with dozens of columns, you can imagine how much time this simple command can save you, as opposed to manually adjusting each column width. When formatting columns, I tend to just use Alt + O + C + A, but sometimes you might want to manually choose the width of a column.
To do this, simply select the column, in this case the “Address” column, and then press Alt + O + C + W. I'll type in 60, press OK, and you can see how this widens the column.
I'll undo with Ctrl + Z. Now that we know how to adjust column width, let's move to row height. Rows typically don't create the same autofit problems that columns do because most data sets do not have text on multiple lines. However, if you do run into this problem, the shortcut Alt + O + R + A will autofit row height. While you might not use autofit commands for rows, you may often want to manually change the row height to make data more readable. In this example, let's increase the height of each data row by a couple of points and see the effect.
First, let's select the top row with Shift + Space Bar, then we'll select all the rows in the data set by holding Ctrl + Shift and pressing the down arrow key. We'll then press the right mouse button, and then R to select row height, and we'll adjust the row height to 18.
By pressing the undo and redo command, you can see how increasing the row height can make your data much more readable. As with most commands in Excel, it's tempting to use the mouse to adjust row and column dimensions.
But hopefully, this lesson has shown you how quickly and easy it is to autofit columns and increase row height using a few simple shortcut commands.