I want to get the value from cell = D6 from all sheets, including new tabs generated, not named main and ssid.
=SUM('CGA '!D6, Trevor!D6, SDL!D6, Daniel!D6, Julian!D6,'Misc Painters'!D6)
Every time I add a new tab, I have to remember to add into the sum formula. I would like to write on script so that I get the sum of cell D6 on tabs, including new ones, except the ones named main and ssid
Try this:
function getAllD6() {
const ss = SpreadsheetApp.getActive();
const list = ss.getSheets().map(sh => [sh.getName(),sh.getRange("D6").getValue()])
Logger.log(JSON.stringify(list))
//or you could also paste it into a sheet with setValues(list);
}