+ Reply to Thread
Results 1 to 8 of 8

macro sheet protect / no protect

  1. #1
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    macro sheet protect / no protect

    Hello to all.
    In the attached file, there are two macro:

    1 to protect the sheet
    2 to unprotect the sheet

    you can a change?
    in cell D2 must be displayed:

    the sheet is protected (if protect)
    or
    the sheet is not protected (if no protect)

    I hope I explained.
    A greeting.
    max_max
    Attached Files Attached Files

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: macro sheet protect / no protect

    Hello max_max,

    Please replace the code in your Module, with the Code below:

    Please Login or Register  to view this content.
    Regards.
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: macro sheet protect / no protect

    Hi max_max,

    I was rethinking your request, and was wondering that since you have provided a password "987654", it just might be that you wanted some input control. If that is in fact the case, then please try the attached sample Workbook, and feel free to change it to your liking.

    Regards.
    Attached Files Attached Files

  4. #4
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: macro sheet protect / no protect

    Thanks Winon,
    This new macro is even better.
    A greeting and thanks again.
    max_max

  5. #5
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: macro sheet protect / no protect

    Hi max_max,

    You are welcome, somehow I just knew you would like it better.

    If you are satisfied with my response, please feel free to add to my reputation by clicking on the star, add to Reputation. and then mark this thread as solved as follows:

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Thanks.

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: macro sheet protect / no protect

    Hi max_max,

    You are welcome, glad you are happy, also thank you for adding to my Reputation.

    Regards.

  7. #7
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: macro sheet protect / no protect

    Hello once again max_max,

    This new macro is even better.
    Personally, I don't like the idea of using Cell D2 as any control condition in the code, and I have removed it. However Cell D2 will still show if the Sheet is Protected or not. You may remove that display in Cell D2 from the Code, if you so wish.

    I am certain that you would prefer my last amendments to the attached sample Workbook much more.

    Have fun!
    Attached Files Attached Files

  8. #8
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    Re: macro sheet protect / no protect

    Hello Winon,
    The last macro is even better.
    A greeting and thanks.
    xam_max

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Password Protect Workaround: Using Macro to act like WS Protect
    By jaredmccullough in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2015, 11:04 AM
  2. Excel 2013 - Protect Range of Cells without using Protect Sheet Button
    By caf20012 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 09-23-2014, 04:50 AM
  3. Edit existing marco to unlock protect sheet, remove set criteria and re protect sheet
    By summer2010 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2013, 09:29 AM
  4. How to protect formula & macro protect without password ?
    By nur2544 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-26-2012, 05:24 AM
  5. Macro to protect only one sheet
    By Crüe in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-17-2011, 02:34 AM
  6. Protect Sheet & Password Protect Code
    By KLahvic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-13-2009, 04:08 PM
  7. Protect Workbook Vs Protect Sheet
    By Poor_pakistani in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 05-25-2006, 09:10 AM

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