I am looking for a way to automatically create a new row on top of older rows each day.

Inside of this row should be the current date.

  • Were you able to implement my solution? – Jacob Jan Tuinstra Sep 1 '13 at 18:30
  • Approximately 340 rows were added since you asked this question..... – Jacob Jan Tuinstra Dec 25 '14 at 7:40

With this little snippet it is possible. Add the code by selecting tools>Script editor in the spreadsheet. Make sure to press the bug button:

enter image description here


// for the active sheet (in essence the first)
function onTop() {
  var ss = SpreadsheetApp.getActiveSheet();
  var date = Utilities.formatDate(new Date(), "GMT+2", "dd/MM/yyyy")

// for a specific sheet
function onTop() {
  var sh = SpreadsheetApp.getActive().getSheetByName("TEST");
  var date = Utilities.formatDate(new Date(), "GMT+2", "dd/MM/yyyy")


In the script editor, choose the following menu option:
enter image description here

and set the trigger as follows (or however you choose): enter image description here


I've created an example file for you: on top


You have to return tomorrow to check it though =)

  • Hi Jacob! How would I modify this script to reference a particular tab? Thanks. :) – Drewdavid Feb 24 '17 at 17:10
  • 1
    Hi @Drewdavid, see code I've added. – Jacob Jan Tuinstra Feb 24 '17 at 19:12
  • How do I set getRange(x) to below the last updated row? Like I want to update the sheet at the bottom. – TheOnlyAnil Nov 23 '19 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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