Well, you could dispense with the locking/unlocking and put this line of code at the top:
Even if the sheet is already password protected, this sets the flag that allows macros to run freely on the locked sheet. It doesn't unprotect the sheet from the user's point of view.
So, there's no need to "reprotect" later because you never removed the protection. See if you get better results with this.
If not, this is still a technique worth adopting.
========
Also, you're on Excel 2007, which means your sheets can easily outstrip the limitations of the "Integer" variable declaration. Go ahead and switch to "Long" for all those declarations to keep from ever running into issues with that.
Bookmarks