Quick question (I think)
I have a sheet that is auto sorting my content that is working well (shown below). My issue is, I no longer manually fill column 6. The content is now auto filled from another sheet. I want to do two things.
// LinkBack to this script:
// How can I make some data on a Google Sheets auto-sorting?
/**
* Automatically sorts the 1st column (not the header row) Descending.
*/
function onEdit(event){
var sheet = Results View();
var editedCell = sheet.getActiveCell();
var columnToSortBy = 6;
var tableRange = "A2:f500"; // What to sort.
{
var range = sheet.getRange(tableRange);
range.sort( { column : columnToSortBy, ascending: false } );
}
}
I have a sheet that is auto sorting my content that is working well (shown below). My issue is, I no longer manually fill column 6. The content is now auto filled from another sheet. I want to do two things.
- How can I set this to make sure it only shows for one sheet (the tab name is "Results View")
- Have this update without having to make changes to the formulas in column 6
// LinkBack to this script:
// How can I make some data on a Google Sheets auto-sorting?
/**
* Automatically sorts the 1st column (not the header row) Descending.
*/
function onEdit(event){
var sheet = Results View();
var editedCell = sheet.getActiveCell();
var columnToSortBy = 6;
var tableRange = "A2:f500"; // What to sort.
{
var range = sheet.getRange(tableRange);
range.sort( { column : columnToSortBy, ascending: false } );
}
}