Answer the question
In order to leave comments, you need to log in
How to do automatic sorting in Google Sheets?
In my table, the entry form is at the top, and at the bottom is what a person fills out in this form. Now I have sorting through the "on change" trigger and it doesn't work very well. How can I make it so that when I enter a new order, sorting is enabled for me?
function sort(){
var ss = SpreadsheetApp.getActiveSpreadsheet();
var as2 = ss.getSheetByName("02") //лист 2
var editedCell = ss.getActiveRange().getValue();
var cell2 = as2.getRange("B7:B").getValues()
if(editedCell!=cell2 ){ //лист 2
as2.getRange('A7:P').sort([{column: 2, ascending: true}]);
}
}
Answer the question
In order to leave comments, you need to log in
Issue resolved
var ss = SpreadsheetApp.getActiveSpreadsheet();
- replace with
var ss = SpreadsheetApp.openById( "тут ваш id таблицы");
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question