I lock all of my worksheets to prevent modification of data and to control user workflow (also to do a meager attempt at protecting work product).
In the past I've been putting ActiveSheet.Unprotect Password="xxx" along with a Protect statement and a few other lines of code at the end on every page to allow certain VBA routines to make necessary modifications on the worksheet. I recently thought that if I were to add this code to a set of procedures in ThisWorkbook and call it I could stop having to add the same code over and over to my worksheet VBA code. The trouble is that in doing so, I need to make the procedures Public, which sorta defeats the purpose if anyone can run the code from the Macro window.
So either I need to find a way to hide the code or maybe I'm going about unlocking and locking the wrong way entirely?
Bookmarks