Forum Discussion
Cyndie_Birdsong
Mar 28, 2021Copper Contributor
Having issue with Activesheet.Unprotect allowing all VBA code to run.
I have some macros on a sheet that is protected as it's set up like a user form, which I have protected so it doesn't get messed up by the various users. I've unlocked the cells they can modify, and ...
Cyndie_Birdsong
Mar 28, 2021Copper Contributor
But that's what I'm doing, I have ActiveSheet.Unprotect at the beginning of that sub & ActiveSheet.Protect at the end. Are you saying to eliminate this part?
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
There is more code in that sub but this was the line it was hanging up at..
Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
There is more code in that sub but this was the line it was hanging up at..
HansVogelaar
Mar 28, 2021MVP
I would have expected your code to stop at
AllowFormattingCells = True
since that isn't valid by itself.
- Cyndie_BirdsongMar 28, 2021Copper Contributorthanks - so that's supposed to go after I re-protect the sheet? I do have them unlocked via the Format Cells settings, so do I even need that part? I really just need to unlock the protection to run the code and then re-protect at the end. I also tried adding UserInterFaceOnly = true but that didn't work either. I'm sure it's something stupid that I'm missing.. 😉
- HansVogelaarMar 28, 2021MVP
Have you tried the code posted by Peter Bartholomew or by me?