How to Auto Insert Timestamp in Google Sheet

preview_player
Показать описание
► Below are the Tools we use to make our Videos more engaging :

How to Auto Insert Timestamp in Google Sheet

Copy the script from above blog post.

Please like and share this video. If you have any questions, please ask them in comment section.

Subscribe to our channel for more such videos.
Рекомендации по теме
Комментарии
Автор

Getting an error
TypeError: Cannot read property "source from undefined.(line 5, file "Code")

Please help

aquabestindian
Автор

Hi, do you know how to write a script that replaces the ctrl + v key to copy and paste certain cells into the Google Sheet. Or recommend a paid specialist

omer
Автор

I had problems with the code you provided on your blog. Spent time typing down the code you are showing in the video and luckily it worked for me! Thank you so much InternetGeeks. And for those who have some issues from the code in the blog, try this one - CREDITS to the owner and author of this code "InternetGeeks".

function onEdit(event)
{
var timezone = "GMT-5";
var timestamp_format = "MM-dd-yyyy HH:mm:ss";
var sheet =

// note: actRng = the cell being updated
var actRng =
var index = actRng.getRowIndex();

var headers = sheet.getRange(1, 1, 1,
var dateCol = headers[0].indexOf('Last Updated');
//Change 'Last Updated' to Column Title where timestamp need to be inserted

if (dateCol > -1 && index > 1) { // only timestamp if 'Last Updated' header exists, but not in the header row itself!
var cell = sheet.getRange(index, dateCol + 1);
var date = Utilities.formatDate(new Date(), timezone, timestamp_format);
cell.setValue(date);
}
}

iamsammichael
Автор

The code in the video didn't work for me, however, the code in the blog works perfectly!
Now I'd like that if a date has already been set, I do not want it to update it automatically, for example if I will only 3-5 days later be able to enter the Coupon ID. Or if someone changes email address and I want to update it, and still want the function to keep the Date Sent it entered in the first place.

badenbadenn
Автор

Its working for single column update. But how can we auto fill date stamp in multiple columns i.e after updating of one column, date should be stamp in next column, i have to do this thing in multiple columns in one sheet as well as in other sheets of same spread sheet. pl suggest.

SSKedia-brfl
Автор

I want to default the current time in the column after the date, how do I do that?

steveengebretson
Автор

Is there a way to add the date to one column and the time to another?

mcbecka
Автор

Will it then work on a mobile phone? Let's say on my iPhone ?

charalamposkounes
Автор

Hi
Many thanks for the code which has fixed part 1 of my problem. However it has caused another one. I have copied the code to apply to 3 different tabs so that I can track a race (start, finished and retired). I successfully enter the number and timestamp the start but when I enter the same number into the finish or retired tab, the start time is updated with the finish time. How can I stop this happening please? I am happy to share the googledoc if it helps. Thanks

laurawalker
Автор

function onEdit(event)
{
var timezone = "GMT-5";
var timestamp_format = "MM-dd-yyyy"; // Timestamp Format.
var updateColName = "Email";
var timeStampColName = "Date Sent";
var sheet = //Name of the sheet where you want to run this script.


var actRng =
var editColumn = actRng.getColumn();
var index = actRng.getRowIndex();
var headers = sheet.getRange(1, 1, 1,
var dateCol =
var updateCol = updateCol = updateCol+1;
if (dateCol > -1 && index > 1 && editColumn == updateCol) { // only timestamp if 'Last Updated' header exists, but not in the header row itself!
var cell = sheet.getRange(index, dateCol + 1);
var date = Utilities.formatDate(new Date(), timezone, timestamp_format);
cell.setValue(date);
}
}

DiegoMedrano
Автор

hi mate
following your code date stamp works perfectly but I am not able to make it work for time stamp.

pickwickgroup
Автор

Can this be done in multiple columns? Like column A will be input day 1 then column B will be the time stamp, column C is input day 2 then column D is input day 2 time stamp

eighteight
Автор

similarly, what is the code to find last row in a column to enter a value

fabfab
Автор

HI azad I run your code and its runs very smoothly but i like to know in your data your have only 3 fi eld but in my case i have 8 field so, tell me how do i do the coding like i ahve a cond. If the the use say yes then it will automatically pick the data and time stamp. help me to learn

bkravi
Автор

Hello Azad, it doesn't work for me I get an error saying "Cannot read property "source from undefined.(line 7, file "Code")

bpatel
Автор

Hello,
Is there a way to have two functions running for two different columns at two different time stamps on the same script?

meganpowell
Автор

TypeError: Cannot read property "source" from undefined. (line 6, file "Timestamp") Having the same problem. Can anyone please help me to sort it out.

sumitkhan
Автор

hi, if i want auto timestamp many cell/one row??? example : type on colum A --> auto time on colum C and type on colum B --> auto time on colum D ...

coientinphong
Автор

Hi, your script works fine if I manually enter data, but I need to timestamp as I paste data in, a row at a time.
The script doesnt work with this, can you advise what to change in the script?

eddiemaughan
Автор

The timestamp is great, however, has anyone worked out how to string multiple timestamps into one sheet? I'm trying to timestamp opened/closed, but it appears that only one timestamp function works at a time? Is there away to string two onedit functions together?

chrislogie