+ Reply to Thread
Results 1 to 7 of 7

Protecting and unprotecting a cell

  1. #1
    Registered User
    Join Date
    01-08-2010
    Location
    Montréal Québec
    MS-Off Ver
    Excel 2003
    Posts
    9

    Protecting and unprotecting a cell

    Hi,

    My little loop checks if the value in a cell equals a number. At first, it hides or unhides rows if it equals the number I am looking for(Works Perfect). It then checks another colums to see if it equals another number I am looking for, and it "should" protect or unprotect another cell in the same row(the part where I have problems with).

    Here is my code:
    Please Login or Register  to view this content.
    Last edited by royUK; 01-08-2010 at 01:13 PM. Reason: add code tags

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Problem with protecting and unprotecting a cell

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Added this time
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Problem with protecting and unprotecting a cell

    Try this
    Please Login or Register  to view this content.
    Last edited by royUK; 01-08-2010 at 01:49 PM. Reason: amend code

  4. #4
    Registered User
    Join Date
    01-08-2010
    Location
    Montréal Québec
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Problem with protecting and unprotecting a cell

    Seems like it is not protecting my worksheet back, I need the worksheet to be protected after change and allow user to Format rows. So I think that this line is not correct
    Please Login or Register  to view this content.

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Problem with protecting and unprotecting a cell

    I've changed the code,try the new code

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Problem with protecting and unprotecting a cell

    Just noticed that none of your variables are declared, & Passowrd may be a word that Excel reserves so that you cannot use it as a variable.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-08-2010
    Location
    Montréal Québec
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Protecting and unprotecting a cell

    The code works, except for the password portion. When I remove the code about the password, it protects and unprotects correctly, but when I add the password lines, it does not work.

+ Reply to Thread

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.6.0 RC 1