+ Reply to Thread
Results 1 to 9 of 9

Protecting worksheet vs workbook

Hybrid View

  1. #1
    Registered User
    Join Date
    01-15-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    53

    Protecting worksheet vs workbook

    Hi there,

    I have a workbook which is being used by multiple users across my work site - it is for them to enter data into and for me to then collect that on a weekly basis. Therefore each worksheet is protected individually without a password - this allows me to lock the information/question cells and only leave the cells designated for writing into open. This is mostly to stop people inadvertantly deleting important information.

    However this workbook is likely to be shared across different work sites (and therefore leave my creative control) - as local users will need to be able to change the information asked for, they need to be able to unlock the worksheets and edit them. But because I have put a lot of effort into creating this file I want to make an 'about' sheet to clearly record myself as the creator etc.

    The issue is that locking the worksheet itself does not prevent it from being deleted (someone could just delete the about page), locking the workbook prevents all the worksheets being deleted/created which stops the about page from being modified but also prevents a legitimate user from making some changes to the other worksheets (especially if they want to add a new one).

    In short what I would like to do is:
    - An about page which can not be modified in any way, or deleted without a password
    - Ordinary worksheets which are ordinarily protected to prevent accidental changes by casual users
    - The ordinary worksheets can then be unprotected to modify the information/questions by a legitimate user
    - If possible, to prevent the VBA code (of ordinary worksheets) being accessible to casual users and to prevent them being deleted/modified

    I fear that these are mutually exclusive, unless there is a way to specifically turn off the delete function for one worksheet.

    Thanks for any suggestions.

  2. #2
    Registered User
    Join Date
    01-15-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Protecting worksheet vs workbook

    Sorry if there are rules against bumping your own thread, down on the third page I doubt anyone will now see it.

    I wonder if what I'm asking is impossible.

  3. #3
    Forum Contributor
    Join Date
    05-29-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    143

    Re: Protecting worksheet vs workbook

    Yes, there is most definitely a way to do this and I'll tell you how... Also, I don't know if bumping is against the rules, but I just did it 3 times on my post lol... I think the community is mad at me bc I don't contribute much, so I'm gonna try to contribute more.

    OK, so to allow users alter cells on a protected worksheet go to the Data tab, go to "Allow Users to Edit Ranges", then hit "New".. You should be able to get it from there.

    To protect the worksheet with a password, go to Data tab, click on protect worksheet and type in the password you want to use.

    If you protect the worksheet/workbook, they shouldn't be able to make any changes to your code.

    Hope this helps!

  4. #4
    Forum Contributor
    Join Date
    05-29-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    143

    Re: Protecting worksheet vs workbook

    Yes, there is most definitely a way to do this and I'll tell you how... Also, I don't know if bumping is against the rules, but I just did it 3 times on my post lol... I think the community is mad at me bc I don't contribute much, so I'm gonna try to contribute more.

    OK, so to allow users alter cells on a protected worksheet go to the Data tab, go to "Allow Users to Edit Ranges", then hit "New".. You should be able to get it from there.

    To protect the worksheet with a password, go to Data tab, click on protect worksheet and type in the password you want to use.

    If you protect the worksheet/workbook, they shouldn't be able to make any changes to your code.

    Hope this helps!

  5. #5
    Registered User
    Join Date
    01-15-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Protecting worksheet vs workbook

    Thanks for the reply.

    The worksheets are already protected - this allows the normal users to enter data into the designated entry cells (by unlocking those cells) and it allows the maintaining user to unprotect the worksheet and make any changes to the forms as required - this includes creating/deleting worksheets and editing the VB code. This works as I want it to.

    I want to create an 'about' worksheet (or text box) which can not be edited, moved or deleted in any way by anyone. This can be achieved by protecting the whole workbook with a password (but this then prevents and creating or deleting of all worksheets - which prevents the maintaining users performing important functions).

    I'm wondering if there is a way to protect the 'about' worksheet from deletion without affecting all the worksheets in the file (protecting individual sheets doesn't prevent deletion).

  6. #6
    Forum Contributor
    Join Date
    05-29-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    143

    Re: Protecting worksheet vs workbook

    You can protect the whole workbook and still allow functionality to certain worksheets by users as I mentioned above. The method i described will do this for you.

  7. #7
    Registered User
    Join Date
    01-15-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Protecting worksheet vs workbook

    I think we're talking about two different issues (or I'm being very stupid!)

    I already allow users to type into the protected worksheets by having the designated cells as 'unlocked'. I just tried the 'allow users to edit range' option out of interest and couldn't get it to work anyway?

    The issue is that I want to prevent the users from being able to delete one worksheet but not be prevented from deleting the others - protecting the sheet does not affect this and protecting the workbook disables the delete option for all the worksheets. I'm wondering if it has to be some VB code to activate/deactivate the protection dynamically or some such.

  8. #8
    Registered User
    Join Date
    01-15-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: Protecting worksheet vs workbook

    Attached an example.

    The 'do not delete' worksheet - I want it so it is impossible to delete this worksheet but you can still delete the data entry worksheet (or add new ones). Both worksheets are protected, but you can still add data to the data entry sheet.
    Attached Files Attached Files

  9. #9
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: Protecting worksheet vs workbook

    as an option, not the best one but you can try it taking into account that the protection can be broken...
    design an UserForm with what you wanna be there and add it in "Private Sub Workbook_Open()", when the wkb is opened the UserForm is displayed ffor a specific time (3..5 sec).
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 01-08-2013, 08:31 PM
  2. Replies: 0
    Last Post: 07-21-2008, 09:18 AM
  3. Protecting a worksheet / workbook with macros
    By WLMPilot in forum Excel General
    Replies: 2
    Last Post: 05-30-2006, 11:40 AM
  4. Replies: 1
    Last Post: 04-18-2006, 01:25 PM
  5. [SOLVED] Disabling Visual Basic Editor After Protecting Worksheet/Workbook
    By Reggie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2006, 09:40 PM

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