Automatically resize columns in Google sheets

前端 未结 5 931
粉色の甜心
粉色の甜心 2021-02-14 11:46

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?

5条回答
  •  醉酒成梦
    2021-02-14 11:59

    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.

提交回复
热议问题