Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Google Sheets App Script Sorting

$
0
0

I'm trying to have an auto sort function only impact one sheet in a workbook rather than all of them... I've done this in other projects and def messed this up along the way - any help is appreciated!!

Here's where I'm at:

SORT_SHEET_NAME = "Active Portfolio";SORT_DATA_RANGE = "A2:043";SORT_ORDER = [{column: 11, ascending: true},{column: 10, ascending: true},{column: 1, ascending: true}];function onEdit(e){  multiSortColumns();}function multiSortColumns(){    var ss = SpreadsheetApp.getActiveSpreadsheet();  var sheet = ss.getActiveSheet();  var range = sheet.getRange(SORT_DATA_RANGE);  range.sort(SORT_ORDER);  ss.toast('Ya Done Good, Kid.');}

It sorts correctly on that sheet, but I don't want all the sheets to sort. Thanks!


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>