Google Sheets - propagate column date formatting to new rows

狂风中的少年 提交于 2019-12-02 07:52:34

问题


The date format in the column is not propagating to new rows, whenever new rows are being added to the bottom of the sheet. The column formatting is not automatically applied - this in regards to date, currency format, alignment etc.


回答1:


Create a function that will run when the form is submitted:

Managing Triggers Manually - Google Documenation

Code.gs

function respondToFormSubmit() {
  //Format entire columns
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheets()[0];
  var range = sheet.getRange("M:Y");

  range.setNumberFormat('dd.mm');
};


来源:https://stackoverflow.com/questions/30412550/google-sheets-propagate-column-date-formatting-to-new-rows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!