Try using
Worksheet.Protect "Password", UserInterfaceOnly := True
If the UserInterfaceOnly parameter is set to true, VBA code can modify protected cells.
Try using
Worksheet.Protect "Password", UserInterfaceOnly := True
If the UserInterfaceOnly parameter is set to true, VBA code can modify protected cells.