quiero duplicar una hoja con rangos protegidos y uso este código, pero necesito copiar esta hoja varias veces por rango.
function copy(){ const sh = SpreadsheetApp.getActiveSpreadsheet(); const ss = sh.getSheetByName("Support Sheet"); const prot = ss.getProtections(SpreadsheetApp.ProtectionType.RANGE) let nSheet = ss.copyTo(sh).setName("Year Data"); let p; for (let i in prot){ p = nSheet.getRange(prot[i].getRange().getA1Notation()).protect(); p.removeEditors(p.getEditors()); if (p.canDomainEdit()) { p.setDomainEdit(false); } } }