Automatically resize columns in Google sheets

2019-04-09 15:23发布

I would like to have columns on google sheets automatically resize to fit my text, without me having to manually resize them after every entry. How do I do this?

3条回答
走好不送
2楼-- · 2019-04-09 15:43

FYI -- For those who don't want to delve into scripting, but want a way to do it faster, you can auto-resize all the columns at once, manually: Hit Cmd+A (or Ctrl+A in Windows) to select everything, then move the mouse to the border between any two column headers -- as if you wanted to resize that one manually-- the cursor changes to an arrow... and double click. Found this trick here.

查看更多
我想做一个坏孩纸
3楼-- · 2019-04-09 15:43

FYI, I don't know an automatic method. But you can do it at once by:

  • selecting desired columns from their headers
  • right-click anywhere on the selected area
  • Select Resize columns...... part from the menu
  • Select Fit to Data
  • Click OK

And you are done.

查看更多
手持菜刀,她持情操
4楼-- · 2019-04-09 15:50

Sounds like you want autoResizeColumn. Make an AppScript script and you can put

var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];

sheet.autoResizeColumn(COLUMN_NUMBER);

Which will resize the specified column based off its contents.

Run the function everytime you want to resize or put it in a trigger like onOpen().

However, it seems to have a maximum size that it will change to.

查看更多
登录 后发表回答