+ Reply to Thread
Results 1 to 4 of 4

Macro error for protected sheet

  1. #1
    Registered User
    Join Date
    07-15-2015
    Location
    new hampshire
    MS-Off Ver
    Office 2010
    Posts
    83

    Macro error for protected sheet

    Why am I getting this error for the "input" sheet?

    Protected sheet, password "1"

    Sub unshade()
    '
    ' unshade Macro
    '

    '
    Range("A1:AD96").Select
    ActiveWindow.SmallScroll Down:=-114
    Range("A1:AD96").Select
    Range("AB1").Activate
    With Selection.Interior
    .PatternColorIndex = xlAutomatic
    .ThemeColor = xlThemeColorDark1
    .TintAndShade = 0
    .PatternTintAndShade = 0
    End With
    Cells.FormatConditions.Delete
    End Sub

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Macro error for protected sheet

    Presumably, some cells are unlocked for data entry and others are locked to protect headings and formulas. You'll get the error if/when your code attempts to format the cells. UnProtect the sheet before formatting and protect it again afterwards.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    07-15-2015
    Location
    new hampshire
    MS-Off Ver
    Office 2010
    Posts
    83

    Re: Macro error for protected sheet

    Thank you!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,461

    Re: Macro error for protected sheet

    You're welcome.



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

+ 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-01-2016, 03:47 PM
  2. [SOLVED] Macro Button Error on Protected Sheet
    By mwatson2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-12-2015, 10:14 AM
  3. [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
  4. get "run time error 1004" when i try to activate macro on protected sheet why?
    By ASAFSWIS in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-19-2013, 11:37 AM
  5. Error- Running a Macro on a Protected Sheet
    By nacho in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2007, 08:21 PM
  6. [SOLVED] Macro Error when Sheet is Protected
    By Johnny in forum Excel General
    Replies: 6
    Last Post: 07-28-2006, 02:45 PM
  7. [SOLVED] macro on protected sheet-error
    By michaelberrier in forum Excel General
    Replies: 6
    Last Post: 06-11-2006, 01:35 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