+ Reply to Thread
Results 1 to 6 of 6

Unprotect code for macro

  1. #1
    Registered User
    Join Date
    04-23-2007
    Posts
    54

    Unprotect code for macro

    I have a macro button on my worksheet that does as follows
    -unhides hidden cells
    -selects print area
    - sets to print portrait
    -prints 2 copies
    -re hides cells
    -protects sheet
    The problem is I cannot run macro because my sheet is allready protected.Is there code I can put in to unprotect first when I click Button.Would appreciate it if anybody can help.Thanks Ben my code is as follows


    Please Login or Register  to view this content.

  2. #2
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Unprotect code for macro

    try tu put this code above your code

    Please Login or Register  to view this content.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Unprotect code for macro

    Try This

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-23-2007
    Posts
    54

    Re: Unprotect code for macro

    Sorry Im not very good with this stuff.Could you put it in where its supposed to go.Nothing I try seems to work.Thanks in advance

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Unprotect code for macro

    It goes at the beginning and the end of your code

  6. #6
    Registered User
    Join Date
    04-23-2007
    Posts
    54

    Re: Unprotect code for macro

    Thanks Got it working

+ 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