Prevent cell value from being modified after entering

sofas

Active Member
Joined
Sep 11, 2022
Messages
469
Office Version
  1. 2019
Platform
  1. Windows
Hello. Is there a way to protect cells after typing in a certain range I have an input list from row 10 to row 20.is there a way to prevent modifying any value entered in any cell in the range. Once the data is entered, only the cell is locked and the rest is left. Unless you unprotect the whole paper with a secret number
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
One way would be to use sheet change event code to ensure cells with data are locked but only if they are within your desired range, and then protect the sheet. The difficulty there (as I see it) is you could not have cells outside of that range set to be locked - and that is the default for all cells. Also, anyone who knows how to get into the code could discover the protection password if you use one, and you'd need to unprotect the sheet if you want to edit a cell in the range that already has content.
Another would be to set 21 variables to the contents of your 21 cell range upon workbook opening. Using the same event as suggested, check if the altered cell value in that range matches the corresponding variable and the variable already has a value. If they are not the same, over-write the entered value with the saved value and raise a message saying existing values in the range cannot be changed. Of course, you may want to provide a means for an admin to be able to alter existing values.

Wait and see if you get a better answer because I'm not really an Excel guru, but I try to help where possible.
 
Upvote 0

Forum statistics

Threads
1,215,159
Messages
6,123,346
Members
449,097
Latest member
thnirmitha

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