Sort Range When New Data Entered

Описание к видео Sort Range When New Data Entered

How to sort a range when a new row of data is added.

Important note:
Make sure you specify which column will be filled last to most easily use this script.

Sheet (Make a copy from the File menu)
https://docs.google.com/spreadsheets/...

Script
function onEdit(e){
if (!e) throw "Do not run from Editor";

autoSortEdit(e);
}

function autoSortEdit(e){
const src = e.source.getActiveSheet();
const r = e.range;

if (src.getName() != "Sheet1" || r.rowStart == 1 || r.columnStart != 5) return;

let range = src.getRange(2,1,src.getLastRow()-1,5);

range.sort(1);
}

Documentation
https://developers.google.com/apps-sc...)


Connect with me:
[email protected]
• spencerfarris.me
• www.linkedin.com/in/spencer-farris/
• Twitter @FarrisSpencer
• Google Product Expert support.google.com/docs/profile/12305

Donate on Paypal: [email protected]

Комментарии

Информация по комментариям в разработке