+ Reply to Thread
Results 1 to 3 of 3

Protect Sheet - VB code to specify password

Hybrid View

  1. #1
    Darin Kramer
    Guest

    Protect Sheet - VB code to specify password


    Howdie,

    Sheets("A").protect is how to protect a sheet, and similar
    Sheets("B").Unprotect.
    I run a Macro that first unprotects a sheet, then when Macro is finished
    Re protects the sheet.

    I want to now specify a password, lets say ABC.
    Whats the VB to do that....?

    Thanks

    D

    *** Sent via Developersdex http://www.developersdex.com ***

  2. #2
    Mauro Gamberini
    Guest

    Re: Protect Sheet - VB code to specify password

    Public sub yourMacro()

    Shetts("A").Unprotect "ABC"
    'Your code
    Sheets("A").Protect "ABC"

    End Sub

    --
    ----------------------------
    Mauro Gamberini

    > Sheets("A").protect is how to protect a sheet, and similar
    > Sheets("B").Unprotect.
    > I run a Macro that first unprotects a sheet, then when Macro is finished
    > Re protects the sheet.
    >
    > I want to now specify a password, lets say ABC.
    > Whats the VB to do that....?




  3. #3
    Xcelion
    Guest

    RE: Protect Sheet - VB code to specify password

    Hi Darin,

    Sheet("B").Unprotect "ABC"
    assuming "ABC" is your password

    Thanks
    Xcelion


    "Darin Kramer" wrote:

    >
    > Howdie,
    >
    > Sheets("A").protect is how to protect a sheet, and similar
    > Sheets("B").Unprotect.
    > I run a Macro that first unprotects a sheet, then when Macro is finished
    > Re protects the sheet.
    >
    > I want to now specify a password, lets say ABC.
    > Whats the VB to do that....?
    >
    > Thanks
    >
    > D
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >


+ 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