Protect workbook
Sub ProtectWorkbook() Dim wb As Workbook Set wb = ThisWorkbook wb.Protect "Excel2003", True, True 'wb.Unprotect End Sub
1. | Show the workbook protection | ||
2. | Unprotect Workbook | ||
3. | checks the UserName; if it is not Admin, this code protects each sheet from user changes |