+ Reply to Thread
Results 1 to 3 of 3

How do you protect multiple worksheets at the same time while only allowing users to selec

  1. #1
    Registered User
    Join Date
    03-13-2013
    Location
    Wintersville, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    7

    Exclamation How do you protect multiple worksheets at the same time while only allowing users to selec

    How do you protect multiple worksheets at the same time while only allowing users to select unlocked cells? I am aware that Excel does not support this function unless you run a VBA macro. I found the VBA code to protect multiple worksheets at the same time, but when I test the worksheet, a user can select any cell they desire. I want users to only manipulate unlocked cells. I have several complex formulas that need to be preserved. The following is the code I already have. Can someone please help me?

    Sub ProtectAllSheets()

    For Each ws In ActiveWorkbook.Worksheets

    ws.Protect Password:="secret123"

    Next ws

    MsgBox "All Worksheets Protected"

    End Sub

    Sub UnProtectAllSheets()

    For Each ws In ActiveWorkbook.Worksheets

    ws.Unprotect Password:="secret123"

    Next ws

    MsgBox "All Worksheets Unlocked"

    End Sub

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: How do you protect multiple worksheets at the same time while only allowing users to s

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-13-2013
    Location
    Wintersville, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: How do you protect multiple worksheets at the same time while only allowing users to s

    Thank you very much. You are a life saver. Worked perfectly.

+ 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