Vba Set Worksheet Protection. When you protect a sheet with UserInterfaceOnly, protection is applied to user actions (basically, keyboard and mouse operations), but VBA is free to modify the worksheet as if there was no protection. Protects a worksheet so that it cannot be modified.
Not what you notice is that compared to acquiring the Worksheet by its VBA Name, when using the defaults Worksheets. Protects a worksheet so that it cannot be modified. This tutorial explains how to use VBA to protect worksheet with password.
Worksheet Protection allows you to lock certain aspects of the sheet from editing.
You can change the protection permissions by recording the macro with a different set of selections in the dialog box.
It sets the UserInterfaceOnly to True. There are a TON of different ways to reference workbooks & worksheets, and provide the right context in VBA. I have VBA code that runs on the workbook open event to enable worksheet protection for all worksheets.