Hi everyone,
So the default for protect sheet is "select unlocked cells" only. I want to enable "format cells" which is all good when I do it manually, HOWEVER, when I run the code...
activesheet.unprotect
'other code
activesheet.protect
it appears to reset the protected elements back to the default. Therefore, my worksheet becomes overprotected and whenever I want to format a cell, i need to manually go back and change the settings again. I also have a stopwatch timing assigned macro that I really want to keep the code to an absolute minimum so that it runs FAST because I want to record multiple time stamps to within around a 10th of a second. I could simply add activesheet.unprotect to the time stamp macro, but every line slows it down.
Is there a method that will not cause the protect sheet elements to reset to the default when the above VBA code is run??
So the default for protect sheet is "select unlocked cells" only. I want to enable "format cells" which is all good when I do it manually, HOWEVER, when I run the code...
activesheet.unprotect
'other code
activesheet.protect
it appears to reset the protected elements back to the default. Therefore, my worksheet becomes overprotected and whenever I want to format a cell, i need to manually go back and change the settings again. I also have a stopwatch timing assigned macro that I really want to keep the code to an absolute minimum so that it runs FAST because I want to record multiple time stamps to within around a 10th of a second. I could simply add activesheet.unprotect to the time stamp macro, but every line slows it down.
Is there a method that will not cause the protect sheet elements to reset to the default when the above VBA code is run??