I have a Google Sheet that users need to submit values weekly.Once they submit using a button, it should do the following:
- Copy the values on the submit sheet to the total sheet of that client name for that week. (This example is week 6) (Green cells)
- Update the submit sheet to show the next week's number. (Yellow cell)
- Clear the contents of the green cells on the submit sheet for the client to prepare the sheet with next weeks data.
Code I have so far:
var weekValue = spreadsheet.getRange('C5').getValue();spreadsheet.setActiveSheet(spreadsheet.getSheetByName('Swiss Submit'), true);spreadsheet.getRange('D7:D8').activate();spreadsheet.setActiveSheet(spreadsheet.getSheetByName('Swiss Total'), true);spreadsheet.getRange('\'Swiss Submit\'!D7:D8').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);spreadsheet.setActiveSheet(spreadsheet.getSheetByName('Swiss Submit'), true);spreadsheet.getRange('C5').activate();spreadsheet.getCurrentCell().setValue(weekValue + 1);spreadsheet.getRange('D7:D8').activate();spreadsheet.getActiveRangeList().clear({contentsOnly: true, skipFilteredRows: true});Issues I am facing: How do I get it to paste in the column with the week's number on top?
Link to google sheet: https://docs.google.com/spreadsheets/d/1d2RnsDMZYmnmnBpdtPpmTuoIxkP3uDhdLOQ7pB3An94/edit?usp=sharing