Closed Thread
Results 1 to 7 of 7

Unprotect the multiple sheets and protect them again

  1. #1
    Registered User
    Join Date
    10-15-2012
    Location
    Faisalabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    9

    Unprotect the multiple sheets and protect them again

    I have a workbook that contains 13 sheets. Sheet5, Sheet 7, Sheet 8, Sheet 9, Sheet 11 are protected by vb codes and the remaining sheets are unprotected. I want to do following things with the help of a macro.
    i) I want to unprotect the protected sheets (i.e Sheet5, Sheet 7, Sheet 8, Sheet 9, Sheet 11)
    ii) Then want to write my vb codes ( I already have) that’ll perform copy paste function among above mentioned sheets
    iii) And then Protect the above sheets again.
    iv) I want to run this macro when I click on Cell A10 of Sheet1.
    Any help will be highly appreciated.
    Last edited by itisalikhan; 12-08-2012 at 06:09 AM.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Help on a Macro plz

    here is a macro that may help you. It has to be in your Sheet1 code.
    Please Login or Register  to view this content.
    you can see the attached file as example.
    Attached Files Attached Files
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    10-15-2012
    Location
    Faisalabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Help on a Macro plz

    Thanks a lot for your kind guidance. Actually, i don't want to write the code as "Private Sub". i want to write it in the module. I want to do somthing like given below:-

    Please Login or Register  to view this content.
    Can you please
    i) shorten the highlighted codes for me
    ii) triger the macro when i click on cell A10 of Sheet 1
    Last edited by itisalikhan; 12-08-2012 at 06:11 AM.

  4. #4
    Forum Contributor
    Join Date
    11-07-2012
    Location
    .
    MS-Off Ver
    2003 - 2013 for Windows
    Posts
    121

    Re: Help on a Macro plz

    Hello,

    Please consult the forum rules (linked to above in the navigation bar)

    Please change your thread title to describe your issue and please post code in code tags.
    regards, LMP

  5. #5
    Registered User
    Join Date
    10-15-2012
    Location
    Faisalabad, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Unprotect the multiple sheets and protect them again

    Hi there! LMP
    Please, excuse my ignorance. Needful has been done. I'll be carefull in future.

  6. #6
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Unprotect the multiple sheets and protect them again

    I don't see how to shorten your code to unprotect sheets and I don't even think it is doable.
    If also think the only way to know if a cell is changed or selected is by EVENTS PROCEDURES which out to be specific in one sheet as I did.
    If you find another way, I'd like to see it.
    Regards

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Unprotect the multiple sheets and protect them again

    Welcome to the Forum, unfortunately:

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    http://www.excelforum.com/excel-prog...ll-sheets.html


    Thread Closed.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

Closed 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