I am an absolute zero in programming Scripts for Google tabs. Sorry if I ask a strange question, or fill it out incorrectly. I am really newbie on this site.
There is an example of a sheets: Columns A and B are just numbers Column C and D contain formulas. Like C2=(A2+B2), D2=(A2-B2)
A task: I want that when I click on the button or the checkbox next to the line. All values on this line were inserted as values. (I mean, formulas were deleted and replaced with values) and the checkbox was deleted.
I tried to do it through recording a macro and got the code, but I still couldn't figure it out:
- how to activate the script for the checkbox.
- how to make each line have its own checkbox and it works.
function _111() {
var spreadsheet = SpreadsheetApp.getActive();
spreadsheet.getRange('E2').activate();
spreadsheet.getCurrentCell().setValue('TRUE');
spreadsheet.getRange('A2:D2').activate();
spreadsheet.getRange('A2:D2').copyTo(spreadsheet.getActiveRange(), SpreadsheetApp.CopyPasteType.PASTE_VALUES, false);
spreadsheet.getRange('E2').activate();
spreadsheet.getActiveRangeList().clear({contentsOnly: true, skipFilteredRows: true});
};
Please help me if you can.
UPD Special for MetaMan: My TAB Name of sheet is "Sell tab"