Google Sheets - propagate column date formatting t

2020-04-14 01:45发布

问题:

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');
};