+ Reply to Thread
Results 1 to 3 of 3

Macro to Unprotect Sheet, Sort then Protect Sheet

  1. #1
    Registered User
    Join Date
    08-30-2010
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Macro to Unprotect Sheet, Sort then Protect Sheet

    Hello,

    I'm wondering if someone would be able to help with a little macro problem. I'm a complete novice with macros and have had to Google everything for this but it's not helping me with the last problem.

    I have a sheet which needs a macro to unprotect the sheet, sort the data then protect the sheet again. I have been able to create the macro however I don't want the spreadsheet users to be asked for the password (although I still want the password there). Every time I run the macro it asks for the password and I don't want it to.

    So far I have:

    Sub UnProtectSheet()

    ActiveSheet.Unprotect
    Password="password"

    End Sub

    then the code for sorting

    Sub ProtectSheet()

    ActiveSheet.Protect
    Password="password"

    End Sub

    Any help which can be provided would be very much appreciated!

    Many Thanks,

    Lisa

  2. #2
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Macro to Unprotect Sheet, Sort then Protect Sheet

    Hi lisamckinney
    Combine all into one like so.
    Please Login or Register  to view this content.
    Last edited by ABabeNChrist; 10-30-2010 at 04:45 PM.

  3. #3
    Registered User
    Join Date
    08-30-2010
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Macro to Unprotect Sheet, Sort then Protect Sheet

    Total genius! Thanks so much!

+ 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