Resizing Excel columns

I’ve been asked about automatically resizing excel columns in an exported dataset. It can be done, but it’s a pain. Mostly because there’s no friendly way to go from the length of a string to a length in pixels of a font that may (or may not) exist on a target machine. Add in anyone that has changed their Screen DPI setting, or uses a different default font on their Excel installation, and thing can get hectic in a hurry…

So this is a quick Excel tip to give your end-users. Hopefully it will make users happy, they get to learn something new, and make us look like geniuses all at the same time.

  1. Select All
  2. instead of dragging a column separator to resize it, double-click it. This will autosize all highlighted columns.

Here’s YouTube example to illustrate:

Note: I use WPS Office instead of M$ Office, but the method is the same.