Hi
I have this excel sheet where in data entered in Columns P - S should get locked, or to be precise protected, once entered and rest of the columns be available for any changes. Please help me with a VBA code that can make this possible.
Hi
I have this excel sheet where in data entered in Columns P - S should get locked, or to be precise protected, once entered and rest of the columns be available for any changes. Please help me with a VBA code that can make this possible.
With a couple of enhancements. The data is now in an excel table since tables copy down formulas, formats and validations. I added a data validation for a date > 1/1/2017 on columns P & Q.
You cannot do any kind of data entry outside the table.
To add a record, click on the Add Record Button. This opens up a new record where all cells except the cell in column P are unlocked. Column P is relocked because it contains a formula and we don't want the users to be able to overwrite it.
After entering in data, Click on the Commit Record Button. You will get a warning that the columns will be locked. Last chance to change your mind. The macro also checks to make sure both columns P and Q have data. If you answer yes to the commit, then Q:R are locked.
You can edit any cell in the table at any time except for columns P:R. Only a new "add record" row allows entry in P & Q.
The password is "Password" - you can see in the code where you would have to change this.
Unprotect the sheet, remove test data, reprotect the sheet with the password.
One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.
A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.
This is extremely good! Just what I wanted. Thanks a ton for all the efforts put in coding this.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks