+ Reply to Thread
Results 1 to 3 of 3

Macro Button Error on Protected Sheet

  1. #1
    Registered User
    Join Date
    07-21-2014
    Location
    Georgia
    MS-Off Ver
    Office 2013
    Posts
    17

    Macro Button Error on Protected Sheet

    I'm just learning the basics of VBA so keep it "in english" for me!

    I need this sheet protected so my team will only edit the necessary fields. I created the following macro and bound it to a button:

    Please Login or Register  to view this content.
    It works perfectly when Unprotected, but after protecting the sheet I get the error shown below. I have read I could code it to Unprotect > Clear Cells > Protect, but if you give it any level of abuse it could leave the sheet Unprotected. The individuals who will be using these sheets are not very computer literate and are exactly the type of people who would hit the button 20 times if they didn't see the cells clear instantly. Maybe that issue is a myth?

    I appreciate the help!

    G67EJ4V.png

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Macro Button Error on Protected Sheet

    Good morning mwatson2
    Quote Originally Posted by mwatson2 View Post
    I have read I could code it to Unprotect > Clear Cells > Protect, but if you give it any level of abuse it could leave the sheet Unprotected
    I have never heard this, and certainly have no experience of this happening.

    Just record your macro, of you unprotecting the sheet, clearing your cells and reprotecting.

    Trust me, everthing will be fine!

    HTH

    DominicB

  3. #3
    Registered User
    Join Date
    07-21-2014
    Location
    Georgia
    MS-Off Ver
    Office 2013
    Posts
    17

    Re: Macro Button Error on Protected Sheet

    Found the problem! I had a typo in the range(s) that included a protected cell, I tweaked the code to have the appropriate, unprotected cells and everything worked as intended! (That's the nature of coding I guess!)

+ 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. Run Macro Button When Sheet is Protected
    By ditee26 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-07-2014, 12:48 PM
  2. [SOLVED] Macro Giving Error On Protected Sheet
    By isc0rpi0 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-09-2013, 01:07 AM
  3. [SOLVED] Macro Error when Sheet is Protected
    By Johnny in forum Excel General
    Replies: 6
    Last Post: 07-28-2006, 02:45 PM
  4. [SOLVED] macro on protected sheet-error
    By michaelberrier in forum Excel General
    Replies: 6
    Last Post: 06-11-2006, 01:35 PM
  5. [SOLVED] use macro button to run macro in protected sheet
    By earl in forum Excel General
    Replies: 3
    Last Post: 02-26-2006, 06:25 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