I have a workbook that contains around 150 sheets and I’m trying to create an index of all of the sheets with a hyperlink from the index to each of the individual sheets.
In the index sheet i have a list of all the sheet names in column A and the formula INDIRECT("’"&A1&"'!AF1”) in column B. Then in cell AF1 of each sheet i have used script (I’ve posted this script below) to populate this cell with the spreadsheetID (URL + ID) of that spreadsheet.
Now i have the problem of adding the formula "=sheetURL()” to cell AF1 of all sheets in my workbook without having to do so manually.
function sheetURL()
{
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getActiveSheet().getSheetId();
return ss.getUrl() + '#gid=' + sheet;
}