I want to remove formulas and paste values in all sheets apart from Base Data and Template.
function myFunction() {
var ss = SpreadsheetApp.getActive();
var allsheets = ss.getSheets();
for(var s in allsheets){
var sheet = allsheets[s];
if(
(sheet.getSheetName() == "Base Data") ||
(sheet.getSheetName() == "Template")
);
function removeFormulas() {
SpreadsheetApp.getActive().getSheets()
.forEach(function (sh) {
var r = sh.getDataRange()
r.copyTo(r, {
contentsOnly: true
})
})
}
}
}
The desired outcome would be to leave the formulas in Base Data and Template alone but for the other tabs to have them removed and the values maintained.