My code is saved in a Google Sheets document and here is how it looks:
ss = SpreadsheetApp.getActiveSpreadsheet();
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var menuEntries = [ {name: "10 Rows", functionName: "TenRows"},
{name: "20 Rows", functionName: "TwentyRows"},
{name: "30 Rows", functionName: "ThirtyRows"},
{name: "40 Rows", functionName: "FortyRows"},
{name: "50 Rows", functionName: "FiftyRows"}]
ss.addMenu("Insert Rows", menuEntries);
}
function TenRows() {
SpreadsheetApp.getActiveSheet().insertRowsBefore(2,10);
}
function TwentyRows() {
SpreadsheetApp.getActiveSheet().insertRowsBefore(2,20);
}
function ThirtyRows() {
SpreadsheetApp.getActiveSheet().insertRowsBefore(2,30);
}
function FortyRows() {
SpreadsheetApp.getActiveSheet().insertRowsBefore(2,40);
}
function FiftyRows() {
SpreadsheetApp.getActiveSheet().insertRowsBefore(2,50);
}
In column C of my spreadsheet, there are numbers in each row in descending order like this:
C
7317
7316
7315
7314
7313
When I execute my script to insert rows, how can I ensure that the ascending number sequence continues in column C automatically?
Thanks