I'm trying to put the name of certain sheets in a column (excluding the names of other sheets I don't want). I have created the array but, it does not appear. I want the information to be placed in A3:A105
.
I have tried to set the value of the column using indexOf
.
function sheetNames() {
var out = [];
var spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();
var exclude = ["About Me", "Contractors", "All Group Bids", "Bid Summary"];
var bidsheet = spreadsheet.getSheetByName("Bid Summary");
var column = bidsheet.getRange(3, 1, 105).getValue();
for (i = 0; i < sheets.length; i++) {
if (exclude.indexOf(sheets[i].getName()) === -1)
{column.setValue(out.push(sheets[i].getName()))};
return out;
}
}
//Nothing appears in the column.