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