Hi,
I have a tab with a FILTER formula on it that filters relevant order information from another tab in the same spreadsheet. I need to ad buttons on every row so that when the user clicks on it, it goes to the source data and changes the cell in the corresponding row from "open" to "CLOSED MANUALLY". My macro is not working though, can someone please have a look at my script to see what I'm doing wrong?
function Try() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getCurrentCell().offset(0, -3).activate();
spreadsheet.setActiveSheet(spreadsheet.getSheetByName('Form responses'), true);
spreadsheet.getCurrentCell().setValue('CLOSED MANUALLY');
spreadsheet.getCurrentCell().offset(1, 0).activate();
var previousSheetIndex = spreadsheet.getActiveSheet().getIndex() - 1;
if (previousSheetIndex <= 0) { previousSheetIndex = spreadsheet.getSheets().length; }
spreadsheet.setActiveSheet(spreadsheet.getSheets()[previousSheetIndex - 1], true);
};
I tried to copy the order number in the macro as it's unique, and then search for it on the other sheet with find and replace but it doesn't work...
Thanks a million
Bookmarks