Help selecting sheet in Google Sheets code?
Iâm havjng some trouble selecting a specific sheet as a condition for a function, Iâll try to explain what Iâm trying to do. Itâs a google apps script code, to sort a table in google sheets. It detects when a cell in column âPâ is edited (column 16) and then sorts the table according to the data in that column. I have a simple checkbox in column P, so when the checkbox is ticked the entire row of the table is moved to the bottom. The data in this row is then converted into âcontentsOnlyâ so that the formulas that previously inhabited the cells in this row no longer operate on new values. This all works perfectly well. The problem Iâm having is that Iâd like the code to only detect changes to column âPâ being made in the sheet âPlaygroundâ, but it detects changes across all sheets in the active spreadsheet. So I could go to a different sheet, and if I edit a cell in column âPâ then the table will be sorted and the bottom row will be converted to âcontentsOnlyâ even though I havenât edited anything on the âPlaygroundâ sheet. I havenât been able to figure out what the problem is, though I suspect it may be in the âeditedCellâ or the âcolumnToSortByâ variables. JavaScript code can be found below. https://code.sololearn.com/cTSu47pZBj1Y/?ref=app