I would like Google Sheets to insert a new column between columns A and B at the start of each new day with that day's date in cell B1. Is there a function or script that would make this possible?

1 Answer 1


Use this script, adjusting the sheet name and date format if necessary. It should be entered in Script Editor, found in Tools menu. After saving the script file, go to Resources > Current project's triggers, and create a trigger to run the function newColumn daily, at your preferred time.

function newColumn() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var sheet = ss.getSheetByName('Sheet1');
  sheet.getRange("B1").setValue(new Date()).setNumberFormat('M/d/yyyy');
  • Thank you! I added this to make the column width smaller as the default cell size was really large due to my Column 1 having lots of text. sheet.autoResizeColumn(2);
    – Alex
    Jul 3, 2016 at 0:54
  • Would it be possible to modify it so that it adds a column right after the last existing column ? Thank you.
    – Franck
    Jan 28, 2020 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.