Ok no problem I added some code to handle the protection of the worksheet.
There are 2 ways to do it in the existing macro every time unprotect before starting the code and protect again at the end of the code.
But because it is an eventcode that would mean sheet gets unprotected many times whenever a change is made in column O. And if for some reason the code freezes the sheet might stay unprotected
So I prefer the other option that is to only apply the protection only to the Userinterface so it won't interfear with the macro's
for this I created a Workbook_open event macro that will set the protection of sheet1 every time you open the Workbook.
This way you can be assured that every time the workbook is open the users cannot manipulate the columns you want to protect
But it won't interfear with the macro's
You also can still do it yourself via the menu, but then you do cannot set the userinterface only option so if you protect a sheet manually the macros will give problems and you will need to close and reopen the workbook to let it function again. But I think after the workbook is finished there is almost never a need to remove protection.
Also when you want to change the password of the protection you must remember to do it in the workbook open code.
Bookmarks