How to schedule copy paste for every minute between two time reference in google spreadsheet?

1.4k views Asked by At

I want to schedule my google spreadsheet in which some cells update every minute, so I want to keep that data in new sheet where it gets pasted in next row & same column(oldest to latest) and this copy/paste command should start at some specific time reference like 9.00AM & end at 3.35PM. Basically I want data from google finance using googlefinance() function in sheet1 of company XYZ (price, volume) and copy/paste paste this data to sheet2 every time values(price, volume) change in sheet1. I had done this using macros for MS Excel but I'm completely new with google spreadsheet. Any help is really appreciated. Thanks in Advance!

1

There are 1 answers

1
Kriggs On

Set time trigger to run every minute and check the time before starting the function:

var now = new Date();
if( now.getHours() > 9 && now.getHours() < 16 && !( now.getHours() == 15 && now.getMinutes > 35 ) ){

restOfCode();
}