View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
baldmosher baldmosher is offline
external usenet poster
 
Posts: 21
Default Code to protect/unprotect a sheet using a macro with password

It wasn't totally clear from the above but I had the same issue where the sub
unprotect wouldn't work.

I realised it was because PW was only defined within "sub protect" but not
within "sub unprotect".

Fixed easily by defining PW within both subroutines.