Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to lock a cell in Excel.
Excel
Range("A1").[1] = True
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Protect' instead of 'Locked' causes an error.
Trying to hide the cell does not lock it.
Selecting the cell does not protect it.
✗ Incorrect
Setting the Locked property to True locks the cell so it can be protected.
2fill in blank
mediumComplete the code to protect the worksheet after locking cells.
Excel
ActiveSheet.[1] "password123"
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Lock' instead of 'Protect' does not secure the sheet.
Trying to 'Hide' the sheet does not protect cells.
Using 'Unlock' is the opposite of what is needed.
✗ Incorrect
The Protect method locks the worksheet so locked cells cannot be edited.
3fill in blank
hardFix the error in the code to unlock a cell before protecting the sheet.
Excel
Range("B2").[1] = False
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Protect' instead of 'Locked' causes errors.
Trying to set 'Hidden' does not unlock the cell.
Selecting the cell does not change its lock status.
✗ Incorrect
To unlock a cell, set its Locked property to False.
4fill in blank
hardFill both blanks to create a dictionary of cell values where the value is greater than 10.
Excel
{cell.Address: cell.Value for cell in Range("A1:A5") if cell.Value [1] [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' instead of '>' reverses the condition.
Using 5 instead of 10 changes the filter criteria.
✗ Incorrect
The code filters cells with values greater than 10 using > and 10.
5fill in blank
hardFill all three blanks to create a dictionary of uppercase cell addresses with values greater than 0.
Excel
result = [1]: [2] for cell in Range("B1:B5") if cell.Value [3] 0}
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using lowercase addresses does not meet the requirement.
Using '<' instead of '>' reverses the filter.
Using cell.Address instead of cell.Value for values is incorrect.
✗ Incorrect
The dictionary uses uppercase addresses as keys, cell values as values, and filters values greater than 0.