+ Reply to Thread
Results 1 to 5 of 5

VBA to permit macros on protected sheet!

  1. #1
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    VBA to permit macros on protected sheet!

    Hi all,

    If it is not too much to ask I was wondering whether someone can help me with the below code.

    Basically I have a workbook which contains numerous macros which I have assigned to different command buttons.

    I would like to protect the workbook so as to ensure data input in some cells but not in others. At the same time I would like to ensure that all macros will still be functional when I hit the command buttons.

    I was trying to use the below code, however, I am still getting some errors.

    Please Login or Register  to view this content.

    If it is possible, is there a better code which could be used and which will permit all macros to be executed?

    (P.S: also tried to insert code in existing macros to unprotect and re-protect but to no avail).

    Appreciate a lot your kind help!

    Thanks

    Keibri

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: VBA to permit macros on protected sheet!

    You could instead have each macro unprotect the sheet(s) it needs to change at the beginning, and then re-protect when it's done.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to permit macros on protected sheet!

    Hi Keibri

    This (almost) always works for me...if you have other actions you wish to allow you'll need to add to the Code.
    Please Login or Register  to view this content.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Forum Contributor
    Join Date
    02-09-2015
    Location
    malta
    MS-Off Ver
    Microsoft 365
    Posts
    383

    Re: VBA to permit macros on protected sheet!

    Hi guys! Thanks for your suggestions!

    Tested the one jaslake provided and it worked great! thanks a lot for your help !

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: VBA to permit macros on protected sheet!

    You're welcome...glad I could help. Thanks for the Rep.

+ 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. Macros don't run with protected sheet
    By Juan Carlos in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2013, 02:09 AM
  2. [SOLVED] Way to Get Around Macros Not Working in Protected Sheet?
    By lyndy256 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-22-2013, 10:12 PM
  3. How to permit VBA codes to work when cells are protected?
    By GenericPat in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-11-2012, 12:34 PM
  4. [SOLVED] Using Macros on protected sheet
    By Bakar in forum Excel General
    Replies: 1
    Last Post: 09-30-2012, 09:34 AM
  5. Excel 2007 : Running macros on a protected sheet
    By Ateyu in forum Excel General
    Replies: 2
    Last Post: 03-15-2010, 05:08 PM
  6. protecting macros for a protected sheet
    By Jon in forum Excel General
    Replies: 3
    Last Post: 03-29-2006, 10:35 AM
  7. Enabling macros while the sheet being protected !
    By dinesh in forum Excel General
    Replies: 13
    Last Post: 09-27-2005, 03:47 PM
  8. [SOLVED] is it possible to use macros when the sheet is protected
    By Dajana in forum Excel General
    Replies: 1
    Last Post: 09-22-2005, 11:05 PM

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