+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    03-14-2010
    Location
    Jersey
    MS-Off Ver
    Excel 2003
    Posts
    30

    Inserting Data from Text Box to "Password" Protected Cell

    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.
    Attached Files Attached Files
    Last edited by bbarrene; 03-19-2010 at 03:46 PM. Reason: Was Half Solved... Sorry for not noticing before.

  2. #2
    Valued Forum Contributor
    Join Date
    08-23-2009
    Location
    Hampshire, UK
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    324

    Re: Inserting Data from Text Box to Protected Cell

    In your macro add
    Code:
    Worksheets("Part_Type").Unprotect
    as the first line and
    Code:
    Worksheets("Part_Type").Protect
    as the last line.

  3. #3
    Registered User
    Join Date
    03-14-2010
    Location
    Jersey
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Inserting Data from Text Box to Protected Cell

    That was simple enough.

    Thanks for the help Huron.

  4. #4
    Registered User
    Join Date
    03-14-2010
    Location
    Jersey
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Inserting Data from Text Box to Protected Cell

    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.

  5. #5
    Valued Forum Contributor
    Join Date
    08-23-2009
    Location
    Hampshire, UK
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    324

    Re: Inserting Data from Text Box to "Password" Protected Cell

    You could change the lines to
    Code:
    ActiveSheet.Unprotect Password:="your password"
    and
    Code:
    ActiveSheet.Protect Password:="your password"
    although the users will be able to see this password if they look at the vba.

  6. #6
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,139

    Re: Inserting Data from Text Box to "Password" Protected Cell

    Hi Huron

    I always advise password protecting the VBa to prevent this.

  7. #7
    Registered User
    Join Date
    03-14-2010
    Location
    Jersey
    MS-Off Ver
    Excel 2003
    Posts
    30

    Re: Inserting Data from Text Box to "Password" Protected Cell

    Thank you both for the input.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0