How To Get A List Of Sheet Names In Google Sheets With Script?
There’s no built-in formula to do this, and we have to write our own script with Google’s Apps Script to achieve the function.
First, go to the Extensions → Apps Script. Second, write our own method getSheetsName in the Apps Script console, and save.
Code snippets:
function getSheetsName() { var sheetNames = new Array() var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets(); for (var i=0 ; i<sheets.length ; i++) { sheetNames.push( [ sheets[i].getName() ] ) } return sheetNames } Then go back to your sheet, and type the formula with the function name we just created in the Apps Script.
Posted by Sean's Blog on Friday, January 28, 2022