+ Reply to Thread
Results 1 to 5 of 5

Excel 2003, protecting only certain cells

  1. #1
    Registered User
    Join Date
    06-13-2007
    Posts
    7

    Excel 2003, protecting only certain cells

    I'm trying to create a situation where cells that aren't blank are passwork protected. So, only cells that contain no data/formulae/etc. can be edited without a password.

    I have reached the point where it's asking me to select the range; am I on the right track?

  2. #2
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127
    Here's an idea:

    Normally, Excel has all cells as protected status. (If you right click on a cell, go to format cells, then click the protection tab, it will show a check next to Locked). Nonetheless, a cell being locked doesn't do anything unless the worksheet is protected.

    What you want to do is "Unlock" all blank cells. To do this, press F5, then click the button that says special, then click Blanks, then ok. This will select all blanks. Next, right click on one of the highlighted cells, go to format cells, protection, and uncheck the Locked icon.

    Now, you can go to Tools-Protection and protect the sheet, which will lock all the non blanks.

    Let me know if that works.

  3. #3
    Registered User
    Join Date
    06-13-2007
    Posts
    7
    Thank you very much for replying, but the problem is I need some kind of formula. When a blank cell ceases to be blank, I need it to automatically become protected.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    You can't do what you're looking for with a formula, but you can use vba code attached to the worksheet's 'Change' event, like so:
    Please Login or Register  to view this content.
    Copy and paste this code into the worksheet module for the sheet in question. (If it's not "sheet1", you'll have to change that reference in the code.)

    Next, as mentioned earlier, select all of your blank cells using F5 -> Special -> Blanks. Then Format -> Cells.. -> Protection -> untick 'Locked' checkbox. Protect your document. Save.

    Now, when you go to any blank cell you should be able to type into it once. After you exit the cell it will become protected. Don't make any typos.

    hth

  5. #5
    Registered User
    Join Date
    06-13-2007
    Posts
    7
    Could you perhaps show me step-by-step how to do this, since I'm not familiar with the more complicated aspects of Excel.

    edit: doesn't matter
    Last edited by 123456; 06-14-2007 at 02:52 PM.

+ 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