user1588010
user1588010

Reputation: 11

Syntax for sheet.getrange

I am a new convert to Google from Microsoft and the comfort of VBA!

In a Spreadsheet I use

var range = sheet.getRange(2,1,sheet.getMaxRows()-1,sheet.getMaxColumns());

to work on all the columns and sort on multiple columns.

What I need to do is ignore the data in the first column and sort the rest.

An explained solution would be appreciated!

Upvotes: 1

Views: 3440

Answers (1)

Serge insas
Serge insas

Reputation: 46802

If you use range.getValues() you will get a 2 dimension javascript array, you can sort it the way you want and then you can rewrite its value to the sheet using

sheet.getRange(2,1, array.length,array[0].length).setValues(array);

Upvotes: 1

Related Questions