placing a button on each row (in a cell) in Google Sheet that, when pressed, gets system time and places in adjacent cell in that row -
i directed here gafe engineers scripting wasn't directly supported google. i've started looking @ script editor , thought need direction want be.
i have time dropoff, adjustment, time pickup, & total time cells in each row there button next total time cell when clicked system time , place in row's time dropoff cell. calculate total time ((time pickup - time drop off) - adjustment)
.
what easiest way this?
you can workaround making menu on spreadsheet , using current active cell, script add current time on adjacent row:
create spreadsheet , paste code script.
function onopen(e) { spreadsheetapp.getui() .createmenu("utils") .additem('generate system time', 'time') .addtoui(); } function oninstall(e) { onopen(e); } function time(){ var ss = spreadsheetapp.getactive().getactivesheet(); var row = ss.getactivecell().getrow(); var column = ss.getactivecell().getcolumn(); var date= new date(); var seconds = date.getseconds(); var minutes = date.getminutes(); var hour = date.gethours(); ss.getrange(row,column+1).setvalue(date); }
you see new menu called "utils". use must on cell next 1 want add time, , go menu utils, generate system time.
regards.
Comments
Post a Comment