I would like to protect a worksheet to prevent others from being able to delete data.
In the file I have attached, I have a worksheet where I can enter information into a text box.
By cliking submit, the next available cell will fill with the information that I have entered.
All works well when the sheet is unprotected, but when I protect the worksheet, I get an error on the coding.
The only function I would like to have available is to write in the text box and submit to enter the information. Other than that, everything else should be protected. Therefore, all of the Part Type entries should be protected from being edited and deleted. But this prevents me from being able to enter data into the text box to fill in the next available cell.
Does anyone know of a way around this?
Any help will be greatly appreciated.
Thanks.
Last edited by bbarrene; 03-19-2010 at 03:46 PM. Reason: Was Half Solved... Sorry for not noticing before.
In your macro addas the first line andCode:Worksheets("Part_Type").Unprotectas the last line.Code:Worksheets("Part_Type").Protect
That was simple enough.
Thanks for the help Huron.
Huron,
Thanks for the help.
Your reply did what I wanted to do by allowing me to add new entries to the locked cells. However, when I protect the sheet and assign it a password, in order for me to add an entry, I have to enter the password to unprotect the cells. When I enter the password, the data gets entered into the next available cell and the worksheet protects itself again but it is no longer password protected. After submitting an entry, anyone can go in and unprotect the sheet because there is no longer a password.
So, I would like to make it so that I can submit data to the next available cell of the "password protected" cell without having to enter the password. Once that is successful, I would like to reprotect the worksheet and still keep the same password. Can this be done?
Sorry for not stating that this is what I wanted to do also in my first post but I was not aware that you could protect a sheet without a password.
Last edited by bbarrene; 03-19-2010 at 09:14 AM.
You could change the lines toandCode:ActiveSheet.Unprotect Password:="your password"although the users will be able to see this password if they look at the vba.Code:ActiveSheet.Protect Password:="your password"
Hi Huron
I always advise password protecting the VBa to prevent this.
Thank you both for the input.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks