Google Script Sheets Move Row

Just as you can manually drag a line and it will change the whole sheet when it is released, I want to be able to do this in a script, for example: sheet.moveRow (from, to);

Is it possible?

+4
source share
1 answer

You need to get a range reference first and then use the moveTo()range method . Google Documentation - moveTo ()

This is sample code from the documentation:

// The code below will move the first 5 columns over to the 6th column
 var sheet = SpreadsheetApp.getActiveSheet()
 sheet.getRange("A1:E").moveTo(sheet.getRange("F1"));
+3
source

All Articles