Macros on Protected worksheet

  • Thread starter Thread starter Guest
  • Start date Start date
2 ways.

1 - Change the protection to allow macros to modify the sheet. This requires
the addition of a parameter to the protection

Sheets("Sheet1").Protect UserInterfaceOnly:=true

2 - Unprotect the sheet. Run your code. Reprotect the sheet

Sheets("Sheet1").UnProtect Password:="Whatever"
'Your code here
Sheets("Sheet1").Protect Password:="Whatever"
 
Thanks! I'll give it a try.
--
Ronnie


Jim Thomlinson said:
2 ways.

1 - Change the protection to allow macros to modify the sheet. This requires
the addition of a parameter to the protection

Sheets("Sheet1").Protect UserInterfaceOnly:=true

2 - Unprotect the sheet. Run your code. Reprotect the sheet

Sheets("Sheet1").UnProtect Password:="Whatever"
'Your code here
Sheets("Sheet1").Protect Password:="Whatever"
 
Back
Top