Script that auto updates

jswillcox

New Member
Joined
Dec 30, 2015
Messages
32
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.
  1. How can I set this to make sure it only shows for one sheet (the tab name is "Results View")
  2. 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 } );
}
}
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,214,827
Messages
6,121,803
Members
449,048
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top