Reputation: 1
I'm looking to get items in my to-do lists on this spreadsheet automatically sorted based on priority # (1 at the top, and so on) but I want it to automatically sort each time it is edited. Is this possible with the sort function? Thanks for your help in advance!
https://docs.google.com/spreadsheets/d/1KHqe8Kvz0e-pbEnoVN6f6vyIyA7VNtuTSQn40q1qGD8/edit?usp=sharing
Upvotes: 0
Views: 2948
Reputation: 1
it's not. you will need a script which will do exactly what you request. for example:
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Sheet1"); // SHEET NAME
var range = sheet.getRange("A2:Z"); // RANGE TO SORT
function onEdit(e) {
range.sort([{column: 2, ascending: true}]); // COLUMN NUMBER TO SORT
} // TRUE/FALSE FOR ASCENDING/DESCENDING
Upvotes: 1