Consulting

Results 1 to 4 of 4

Thread: sheet protection options

  1. #1
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location

    sheet protection options

    I have the following code that I use to protect all sheets in my workbook.

    [VBA]Sub ProtectAll()
    Dim Sh As Worksheet
    Dim myPassword As String
    myPassword = "password"
    For Each Sh In ThisWorkbook.Worksheets
    Sh.Protect Password:=myPassword
    Next Sh
    End Sub[/VBA]

    Is there a way to modify so that select locked cells in unchecked or false in the protection options?

  2. #2
    VBAX Mentor
    Joined
    Apr 2009
    Location
    Kingsbury
    Posts
    423
    Location
    Hi Wilg

    Try this
    [VBA]
    Range("A1").Select
    Selection.Locked = False
    [/VBA]

    Rob

  3. #3
    VBAX Tutor
    Joined
    Jul 2010
    Posts
    225
    Location
    Sorry, maybe I should clarify further. When protecting sheets I want under where you would normally key your password....

    "Allow all users using this workbook too.."

    "Select Locked Cells" false. or Unchecked.

  4. #4
    VBAX Mentor
    Joined
    Apr 2009
    Location
    Kingsbury
    Posts
    423
    Location
    Wilg

    Do you want an input box to allow all users to select all locked cells with either "Y" or "N" ????

    Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •