136

I have a spreadsheet with many columns. The columns are all a small standard width. Double-clicking the partition line between columns will expand the column width to encompass the longest string in that column.

Is there a shortcut to perform this operation on every column in the spreadsheet?

Brian Agnew
  • 1,055
  • 6
  • 7
MattUebel
  • 1,743
  • 3
  • 14
  • 17

6 Answers6

224

Click where the row and column headers meet, this will select the entire sheet, like so:

alt text

Then double-click any one of the column partition lines.

I do this all the time, and it's as quick as you can get.

Gaff
  • 18,569
  • 15
  • 57
  • 68
Lance Roberts
  • 8,563
  • 9
  • 49
  • 79
24

I don't know about shortcut. I use menu.
1) Select The Full Spreadsheet
2) Select Format
3) Column
4) Autofit Selection

Dave
  • 596
  • 1
  • 4
  • 9
  • 1
    +1 I like this solution because it works on whatever range you select and you can exclude, for instance, titles that you want to span many columns. – dkusleika Jul 08 '10 at 17:02
  • Sometimes for long strings the autofit does not expand to fit the longest line in that column. navigating this tip brought me to the other options of manually setting the width which was useful. – Paul Aug 12 '14 at 14:51
  • And for particularly long strings there are times when Excel just fails. Although, I haven't run into this yet with the newer versions. – Dave Aug 13 '14 at 17:11
  • Could you update this for 2010 please? Or at least specify the version you are explaining this for. – LaRiFaRi Jul 08 '15 at 07:40
  • At the time of this post I believe I was using a 2000 version of office at home and 2003 at work. – Dave Jul 10 '15 at 01:43
13

Ctrl+A to select all cells, then press Alt+H, O, I.

Jawa
  • 3,619
  • 13
  • 31
  • 36
Abhishek Gehlot
  • 216
  • 3
  • 2
6

Try selecting everything (CTRL + A twice rapidly, or just select the columns you want), and then double-click a partition line. In Excel 2007, that solution seems to work just fine; in other words, it automatically sizes each column to its own longest string.

jrc03c
  • 10,142
  • 1
  • 24
  • 15
  • doesn't work in 2003 – Dave Jul 08 '10 at 16:18
  • 3
    It does work in 2003. In both versions, you have to make sure the whole column is selected, not just a range of cells. – dkusleika Jul 08 '10 at 17:01
  • Why CTRL+a *twice*? Was that really needed in some version of Excel? – LaRiFaRi Jul 08 '15 at 07:46
  • @LaRiFaRi: For example in Excel 2013, pressing Ctrl+A _once_ selects the current block of cells, which have contents in them -- equivalent to Ctrl+Shift+Space. The following _second_ Ctrl+A selects the entire sheet. – Lernkurve Nov 10 '16 at 12:52
1

enter image description herein Excel 2016 you can select all with Ctrl + A then on Home tab look for Format menu. Click and select Autofit Column Width

ihor.eth
  • 111
  • 3
-1

Select All - "Control" A

Expand all column width and heights "Alt" H-O-I

Will
  • 1