0
0
Google Sheetsspreadsheet~10 mins

Protected sheets and ranges in Google Sheets - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to protect the entire sheet named "Data".

Google Sheets
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Data");
sheet.[1]();
Drag options to blanks, or click blank then click option'
AsetProtection
BprotectSheet
Cprotect
DprotectRange
Attempts:
3 left
💡 Hint
Common Mistakes
Using methods that don't exist like protectSheet or protectRange.
Confusing protection methods with range selection.
2fill in blank
medium

Complete the code to protect a specific range A1:B10 on the active sheet.

Google Sheets
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("A1:B10");
var protection = range.[1]();
Drag options to blanks, or click blank then click option'
Aprotect
BsetProtection
Clock
DprotectRange
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like setProtection or lock.
Trying to protect the sheet instead of the range.
3fill in blank
hard

Fix the error in the code to remove editors from a protected range.

Google Sheets
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("C1:C5");
var protection = range.protect();
protection.[1]([]);
Drag options to blanks, or click blank then click option'
AdeleteEditors
BremoveEditors
CclearEditors
DsetEditors
Attempts:
3 left
💡 Hint
Common Mistakes
Using removeEditors which does not exist.
Trying to clear or delete editors with wrong method names.
4fill in blank
hard

Fill both blanks to protect a range and set a description.

Google Sheets
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange("D1:D10");
var protection = range.[1]();
protection.[2]("Confidential Data");
Drag options to blanks, or click blank then click option'
Aprotect
BsetDescription
CsetName
Dlock
Attempts:
3 left
💡 Hint
Common Mistakes
Using setName instead of setDescription.
Trying to lock the range with a non-existent method.
5fill in blank
hard

Fill all three blanks to protect a sheet, set a description, and remove all editors.

Google Sheets
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Summary");
var protection = sheet.[1]();
protection.[2]("Sheet locked for editing");
protection.[3]([]);
Drag options to blanks, or click blank then click option'
Aprotect
BsetDescription
CsetEditors
Dlock
Attempts:
3 left
💡 Hint
Common Mistakes
Using lock instead of protect.
Trying to remove editors with a non-existent method.