I currently run a simple daily script to sort my products by price. This is done with freezing the first row (headers).
function myFunction() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
// Sorts the sheet by the column I - the ninth across - , in ascending order
sheet.sort(9);
}
I need to import some data now with a Python script which has issues dealing with frozen rows. So I need to run a cleanup script when it has finished, within my Google Sheet.
How can I delete columns D, F, H and then sort by price in column I (without having to freeze the top row) all with a single Google Script?
Part 1https://developers.google.com/apps-script/reference/spreadsheet/sheet
sheet.deleteColumn(4,6,8);
Part 2 - possible header ignore Google Apps Script: Can I specify a header row when sorting in a script?
sheet.getRange(2, 1, height-1, width+1).sort(width+1);
Range.moveToandRange.sort. developers.google.com/apps-script/reference/spreadsheet/range - SpiderPig//Clear sheet, ready for import clear(); // Import content from Google Sheet # ??- me9867Sheet.clear()andRange.copyTo()for that. - SpiderPig