Hello, I have this script below. Basically, what I want to happened is, every time I pressed one of those script buttons, I want to copy the contents of the rows and paste it to another sheet on the same workbook. I'm using Automate Office Scripts because I have this sheet online and shared to others.
This is the script and this is what the sheet looks like, I can't upload image that's why I just did this lol.
function main(workbook: ExcelScript.Workbook) {
let sourceSheet = workbook.getWorksheet("Timer");
let destSheet = workbook.getWorksheet("Logs");
let sourceRange = sourceSheet.getRange("A2:C2");
let sourceValues = sourceRange.getValues();
let destRange = destSheet.getRange("A2:C2");
destRange.clear();
let destRangeValues = destSheet.getRange("A2:C2").setValues(sourceValues);
}
LOCATIONS: DEPARTURE: ARRIVAL:
LOCATION A: 5:30 AM 6:15 AM SCRIPT BUTTON 1
LOCATION B: 2:30 PM 3:15 PM SCRIPT BUTTON 2