Google Sheets - propagate column date formatting to new rows
Asked Answered
P

1

3

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.

Propagandize answered 23/5, 2015 at 12:15 Comment(3)
I think you can click the column heading, so that the entire column is highlighted, then set the format. Any new rows should have the same format as the column as a whole. This isn't a programming question. The question is better suited for some other site.Amidase
Unfortunately that ain't so easy, rows added by form submissions don't follow the formatting. Perhaps some script or specific array formula can fix it. Edit: Even if I add a row manually the formatting isn't propagated :(Propagandize
Apps Script can run some code every time a form response is submitted. Installable Form Submit TriggerAmidase
A
0

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');
};
Amidase answered 23/5, 2015 at 18:17 Comment(5)
Thanks, I set the trigger to on form submission and started first trail using the code above with 'var cell = sheet.getRange("M:Y"); cell.setNumberFormat('dd.mm');' If I execute it this applied correctly, a new submission also triggers it but the cell is not formated - can you advice?Propagandize
See updated answer. I've tested it, and it works. Please mark answer as correct.Amidase
Thanks, this works fine! I surrender to the remaining formatting though - that's over my head. :)Propagandize
Why the hell isn't number formatting for an entire column just automatically applied to any new rows added to it..? Ridiculous that we should need a script to do thisUndervalue
@Undervalue You can search the Issue Tracker at "issuetracker.google.com" for the same complaint, and star it, or file a new feature request.Amidase

© 2022 - 2024 — McMap. All rights reserved.