+ Reply to Thread
Results 1 to 4 of 4

Protect/unprotect ALL worksheets in workbook ?

  1. #1
    Newsgal
    Guest

    Protect/unprotect ALL worksheets in workbook ?


    -- Is it possible to protect/unprotect all worksheets in a workbook at once
    instead of having to do each individually if the password is the same?

    News Gal

  2. #2
    Chip Pearson
    Guest

    Re: Protect/unprotect ALL worksheets in workbook ?

    The only way to do that is with some VBA code:

    Sub ProtectAll()
    Dim WS As Worksheet
    For Each WS In ActiveWorkbook.Worksheets
    WS.Protect Password:="whatever"
    Next WS
    End Sub


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Newsgal" <[email protected]> wrote in message
    news:[email protected]...
    >
    > -- Is it possible to protect/unprotect all worksheets in a
    > workbook at once
    > instead of having to do each individually if the password is
    > the same?
    >
    > News Gal




  3. #3
    Ron de Bruin
    Guest

    Re: Protect/unprotect ALL worksheets in workbook ?

    The only way is to use a macro to do this

    Sub test()
    Dim sh As Worksheet
    For Each sh In ThisWorkbook.Worksheets
    sh.Unprotect "ron"
    Next sh
    End Sub

    Or
    sh.Protect "ron"



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl


    "Newsgal" <[email protected]> wrote in message news:[email protected]...
    >
    > -- Is it possible to protect/unprotect all worksheets in a workbook at once
    > instead of having to do each individually if the password is the same?
    >
    > News Gal




  4. #4
    Kevin B
    Guest

    RE: Protect/unprotect ALL worksheets in workbook ?

    This macro would do the trick

    Sub Unprotect()

    Dim wb As Workbook
    Dim ws As Worksheet
    Dim blnIsProtected As Boolean
    Set wb = ActiveWorkbook

    For Each ws In wb.Worksheets
    ws.Unprotect "test"
    Next ws

    Set wb = Nothing
    Set ws = Nothing

    End Sub

    --
    Kevin Backmann


    "Newsgal" wrote:

    >
    > -- Is it possible to protect/unprotect all worksheets in a workbook at once
    > instead of having to do each individually if the password is the same?
    >
    > News Gal


+ 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