Allow Users to Edit Certain Cells While Sheet Protected

klm1988

New Member
Joined
Aug 23, 2011
Messages
15
Hi there

I have a worksheet (called "Criteria"), where my colleagues are filling out certain cells, then using a Macro to save the data to another worksheet (called "Data", in the same excel file), and re-set the fields within the "Critera" worksheet, ready for the next entry.

Other than about 12 cells in "Criteria", I don't want anyone to be able to change or delete anything within the file. So, I protected all of the worksheets, and specified those 12 cells using the Tools, Protection, Allow Users To Edit Ranges Menu.

When the worksheet is protected, it allows me to edit those 12 cells, however, when I run the Macro (saving the 12 cells into the "Data" worksheet), I get an error message, saying that because the worksheet is protected, the macro cannot execute.
I tried un-protecting the "Data" worksheet, but even then, the macro still fails when it tries to clear the content out of the 12 cells that have been edited, because the rest of the sheet is protected.

Is there any way around this? It's been driving me crazy for 2 days now!

Thanks in advance!
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
the macro still fails when it tries to clear the content out of the 12 cells that have been edited

You can add a line to your macro that Unprotects the worksheet prior to clearing out the content of the 12 cells and then add a line that Protects the worksheet again after those contents have been cleared.
 
Upvote 0
That's great, thanks.

The only thing is, when the macro runs and it unprotects the sheet, it'll prompt the other users of the worksheet to enter the password to enable it to complete the macro. There's not really any point in having the protection there if they know the password to take it off.

Is there any other way around that?

Thanks!
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,283
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top