I am attempting to take data from a "worksheet" which will always begin as the active sheet into a seperate sheet that is determined by the month of the year. That has been no problem so far and my code does function in this way. However I can not understand how to take that predetermined amount of info "A9:AG11" in our static worksheet and paste into the next empty set of rows on our shared monthly sheet. Here is my current code that does work, ui button, and all. But it will of course only write over any data already existing on the second sheet. Any help would be appreciated!
function BP3CallTab() {
var ui = SpreadsheetApp.getUi(); // Same variations.
var result = ui.alert(
'Please confirm',
'Ready to Submit 3-Call Audit?',
ui.ButtonSet.YES_NO);
// Process the user's response.
if (result == ui.Button.YES) {
// User clicked "Yes".
copyFunction ();
}
function copyFunction () {
var inputRange = SpreadsheetApp.getActiveSpreadsheet().getRange("A9:AG11");
var inputValues = inputRange.getValues();
var shname = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Dash").getRange("Q4").getValue()
var emptyrow = SpreadsheetApp.getActive();
emptyrow.getRange('A17').activate();
emptyrow.getCurrentCell().getNextDataCell(SpreadsheetApp.Direction.DOWN).activate();
emptyrow.getCurrentCell().offset(1, 0).activate();
var outputRange = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(shname).getRange("A17:AG19").setValues(inputValues);
}
ui.alert('Audit Complete!✅');
if (result ==ui.Button.NO) {
// User clicked "No" or X in the title bar.
ui.alert('No Changes Made.');
}
};