Last active
June 20, 2019 19:29
-
-
Save supernovaplus/d247bb95768e337fa5db645212d8d988 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function companyBankVouchersMove() { | |
var initialScanLocation = 69; | |
var spreadsheet = SpreadsheetApp.openById("-"); | |
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('Company Bank'), true); | |
var column = spreadsheet.getRange('D'+initialScanLocation+':D'); | |
var values = column.getValues(); // get all data in one call | |
var location = 0; | |
while ( values[location][0] != "" ) { | |
location++; | |
} | |
location = location+initialScanLocation; | |
var time = new Date().toLocaleString('lt'); | |
var elm1 = spreadsheet.getRange("D" + ( location-1 ) + ":D" + location); | |
elm1.setValues([[elm1.getValues()[0][0]],["=Vouchers!$G$3"]]); | |
elm1.setNote("script touched this elm1 on "+time); | |
var elm2 = spreadsheet.getRange("G" + ( location-1 ) + ":G" + location); | |
elm2.setValues([[elm2.getValues()[0][0]],["=Vouchers!$P$3"]]); | |
elm2.setNote("script touched this elm2 on "+time); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment