Complete the code to protect the active sheet in Excel using VBA.
ActiveSheet.[1] "mypassword"
The Protect method locks the active sheet with the given password.
Complete the code to unprotect the active sheet with a password.
ActiveSheet.[1] "mypassword"
The Unprotect method removes protection from the active sheet using the password.
Fix the error in the code to protect the sheet with password '1234'.
Worksheets("Sheet1").[1] "1234"
The Protect method requires the password as a string, so it should be in quotes.
Fill both blanks to protect the sheet and allow users to select locked cells.
ActiveSheet.[1] Password:="pass", AllowSelectingLockedCells:=[2]
Use Protect to lock the sheet and set AllowSelectingLockedCells to True to allow selection.
Fill all three blanks to unprotect the sheet, clear contents of cell A1, and then protect it again with a password.
ActiveSheet.[1] Password:="secret" Range("A1").[2] = "" ActiveSheet.[3] Password:="secret"
First, Unprotect unlocks the sheet. Then, setting Value of cell A1 to empty clears it. Finally, Protect locks the sheet again.