Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jun 2002
    Location
    San Leandro, California, USA
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Protect Worksheet(s) (Excel 2003)

    Can the “Protect Worksheet” and “Unprotect Worksheet” commands (from the “Tools” menu) be used for more than one worksheet simultaneously?

  2. #2
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Protect Worksheet(s) (Excel 2003)

    Editted to add: for some reason the link did not work below, try this one http://www.asap-utilities.com/downlo...-utilities.php

    Hi Kim

    There is probably some fancy code way of doing it and I am sure that some examples will be posted for you, I however go the lazy ay and use the free (donate) solution from ASAP http://utilities"]http://www.asap-utilities.com/">http://utilities, http://www.asap-utilities.com/[/url]

    Cheers

    Steve
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  3. #3
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Protect Worksheet(s) (Excel 2003)

    Hi Kim,

    No, these commands cannot be used to simultaneously protect all sheets in the workbook. Only one sheet at a time can be protected. As Steve says, you can use VBA code to do this.

    Here is some code you can use to protect ALL sheets in the workbook. The Password is optional. You can change it of course to anything you want (and just make sure you update the Unprotect Macro password too). If you DO NOT want a password, just delete the word "Password" from both macros, but leave the quotes there, like this:
    mySheet.Protect "", True, True, True

    Copy these macros into a module and you can run it from the Macro Menu, a toolbar or (you can press ALT+F8 to activate the macro dialog.)

    Sub ProtectAllSheets()
    Dim mySheet As Worksheet
    For Each mySheet In Worksheets
    mySheet.Protect "Password", True, True, True
    Next mySheet
    End Sub


    Sub UnProtectAllSheets()
    Dim mySheet As Worksheet
    For Each mySheet In Worksheets
    mySheet.Unprotect "Password"
    Next mySheet
    End Sub
    Regards,
    Rudi

Posting Permissions

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