+ Reply to Thread
Results 1 to 5 of 5

Unprotect & Protect using existing macro

  1. #1
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Unprotect & Protect using existing macro

    I have a worksheet that I have data below row 11.

    Rows 1 thru 11 are protected with password.

    Rows 12 on down are unprotected.

    The macro does a number of things and then sorts the data.

    It works fine when the protection is turned off (no password)

    When I enter the password, the macro will not sort and it will not sort manually either.

    I need a way in the macro, before the sort code, to unprotect (using the password automatically) then allowing the macro to continue on and when finished, the password would again protect the sheet with the same password.

    Does anyone know the code for doing this. I believe that I seen this some years back, but no idea on the syntax.
    Thanks for helping . . .
    Matt @ Launchnet

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Unprotect & Protect using existing macro

    A simple search of the forum would answer your question.

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Unprotect & Protect using existing macro

    Hello Matt,

    Are you saying you can sort the data even after you have entered the password manually?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: Unprotect & Protect using existing macro

    Hi Leith & RoyUK . . .

    Just looked at my email and was interested in your answers.
    RoyUk, this looks correct, but I don't have time today to test. Will advise tomorrow.


    Leith, I can not sort manually if the sheet is password protected.

    Good hearing from both of you.

  5. #5
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Re: Unprotect & Protect using existing macro

    I need this marked as SOLVED please. Sorry, I'm closing a few postings that I forgot to post as solved earlier.

+ 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