PDA

View Full Version : How to Solve using CurrentRegion if cells in Table is Protected



Marsau
10-29-2022, 11:16 AM
Hi there
If I use CurrentRegion and one or more cells are protected in that range it tells me it can't be used with protected cells.
Anyway to solve this?

p45cal
10-30-2022, 04:21 AM
Either:
in the code, unprotect the sheet , do your manipulations, reprotect the sheet.
or:
check out the use of UserInterfaceOnly:=True as one of the arguments of Sheet.Protect; it allows the code to manipulate cells while not allowing the user to do so. Once used, it remains 'in force' until the workbook is closed, so it's a line of code that only needs to be executed once for the sheet some time after the file is opened.

Marsau
10-30-2022, 06:32 AM
Thank you for reply
Will make use of protect / unprotect method
Will lookup the other method and give it a try to