+ Reply to Thread
Results 1 to 7 of 7

How to enable macros with protected worksheet

  1. #1
    Registered User
    Join Date
    07-25-2013
    Location
    Pathumtanee, Thailand
    MS-Off Ver
    Excel 2013
    Posts
    19

    How to enable macros with protected worksheet

    I have been trapped for hours of how to enable macros with protected worksheet.

    Any suggestion please?

    I did try to put UserInterFaceOnly on the vba code of that worksheet. But it still not working when I protected the worksheet.

    Please Login or Register  to view this content.
    Thank you very much in advance
    Last edited by Fotis1991; 09-13-2013 at 04:19 AM. Reason: Add UserInterFace & Mod Note: Added code tags..!

  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: How to enable macros with protected worksheet

    Hello Kevalin,


    At the beginning of your Code add this line:

    Please Login or Register  to view this content.
    And at the end of the Code protect the sheet again:

    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
    Registered User
    Join Date
    07-25-2013
    Location
    Pathumtanee, Thailand
    MS-Off Ver
    Excel 2013
    Posts
    19

    Re: How to enable macros with protected worksheet

    Thank you for your suggestion Winon.
    I am very new to this. I wrote down this code that allows me to select multiple options from a drop down list.
    From the code that you gave me. I tried to add it at the beginning and at the end, but it kept saying error.
    If you don't mind helping me by showing where should I add your code in, I would be very much appreciated. Thanks again heaps
    Please Login or Register  to view this content.
    Last edited by Fotis1991; 09-13-2013 at 04:18 AM. Reason: added code tags

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: How to enable macros with protected worksheet

    @ Kevalin O

    Welcome to the forum

    Pls

    Use code tags around code.

    Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here


    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  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: How to enable macros with protected worksheet

    Hello Kevalin,

    Please try it like this,

    Please Login or Register  to view this content.
    Last edited by Winon; 09-14-2013 at 02:55 AM.

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How to enable macros with protected worksheet

    Hi, Winon,

    I would recommend to have a look at the protect command you supplied (wrong command UserInterFace, you must either use the names for all or use commata to separate the parameters) and move the commands regarding Protection, ScreenUpdating as well as Enable behind the jump mark for the error handler. Itīs not really good to unprotect a sheet, detect an error in the code and leave the sheet unprotected via the error handler. :
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  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: How to enable macros with protected worksheet

    @ HaHoBe,

    Hi Holger,

    Oops!!!,

    You are absolutely correct.

    Thank you for correcting my mistake, my friend!

    Regards

+ 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. Replies: 0
    Last Post: 08-06-2013, 08:21 AM
  2. A password protected Macro to enable and disable other macros?
    By jonvanwyk in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-16-2011, 03:04 PM
  3. Enable Macros in Password-protected Excel File
    By Alleen86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-01-2011, 02:28 PM
  4. How do I enable the spellchecker in a protected worksheet?
    By Anne CFS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-20-2005, 04:05 PM
  5. Enable grouping in protected worksheet
    By malik641 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-06-2005, 07:34 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