I have a simple question: I want to connect specific sheet names in my workbook with a table that contains a range of dates. The sheet names should be something like "blablabla" + Table@1.
Although I have attempted to design a solution, it doesn't seem to be working as expected.
function main(workbook: ExcelScript.Workbook) {
let i = 0;
let sheets = workbook.getWorksheets();
let dates = workbook.getTable("Months").getColumn(1).getRange().getCell(i, 1);
for (let sheet of sheets) {
if (sheet.getName().includes("Capacity split -") && !sheet.getName().includes("Capacity split - Next quarters")){
let newName = 'Capacity split -' + dates[i];
console.log(newName);
sheet.setName(newName)}};
}
I have included screenshots to provide a clearer explanation of what I am trying to achieve.
Screenshots of Tabs :
https://i.sstatic.net/WKkXJ.png
Data in the Table:
https://i.sstatic.net/8r6hv.png
The goal is to establish a connection between the first cell in the table and the corresponding tab.
Can you please assist me with this issue?
Thank you in advance!