+ Reply to Thread
Results 1 to 5 of 5

Macro to pasword Protect worksheets based on Tab color

  1. #1
    Registered User
    Join Date
    05-24-2013
    Location
    London, England (it's a lie!)
    MS-Off Ver
    Excel 2010
    Posts
    25

    Macro to pasword Protect worksheets based on Tab color

    Hi all,
    I'm having to send one worksheet to three users, but don't want them 'accidentally' messing up everyone else's data. I have each user's sheets color coded, and want a macro to lock each colored section with the same password, so that there are 3 passwords (one for each user). Also, leaving it to where we can select locked cells would be great.

    I had pieced one together, and it looked like this
    Please Login or Register  to view this content.
    However, it wouldn't skip to the next wSheet, nor did it protect any sheets.

    My tab colors are 17, 43, and 33 if that will help with the code-writing.

    Thanks!
    Last edited by mturnertombow; 06-13-2013 at 07:59 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Macro to pasword Protect worksheets based on Tab color

    Hi
    Replace the "Else" with "End If" and it will work ok.
    Tony

  3. #3
    Registered User
    Join Date
    05-24-2013
    Location
    London, England (it's a lie!)
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Macro to pasword Protect worksheets based on Tab color

    Thanks Tony! However, it is not letting me click on the cells once it is locked.

    Also, how do I make it do this for the second color? Just do another If inside of there?

  4. #4
    Valued Forum Contributor
    Join Date
    10-26-2008
    Location
    Birmingham, UK
    MS-Off Ver
    All versions up to 2010
    Posts
    1,025

    Re: Macro to pasword Protect worksheets based on Tab color

    Hi
    Yes you can add another If statement for each tab colour where you want the sheet protected.
    Tony

  5. #5
    Registered User
    Join Date
    05-24-2013
    Location
    London, England (it's a lie!)
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Macro to pasword Protect worksheets based on Tab color

    Hey ARGK, I got it, and have it open automatically. It looks like
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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