Can I allow macros to run on a protected sheet?

Anonymous
2010-12-08T21:40:19+00:00

Maybe the answer is a simple no, but I figured I'd ask. I just want to run a simple macro that performs a filter function so I can hide the filter arrows and simplify the filtering. When I try to run the macro while the sheet is protected, I get the following error message "Run-Time error '1004' You cannot use this command on a protected sheet. When I select "debug" the code window opens but I have no idea what to add or where. This is the entirety of the macro:Keyboard Shortcut: Ctrl+y

'

    Selection.AutoFilter Field:=4, Criteria1:="TRUE"

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2010-12-09T01:06:59+00:00

    (what can I say, I'm new).

    For a newbee the learning curve is steep but satisfying. Glad I could help and thanks for the feedback.


    If this post answers your question, please mark it as the Answer.

    Mike H

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2010-12-08T22:48:02+00:00

    Awesome, it worked perfectly once I played with the positioning of the lines within the code box (what can I say, I'm new).

    Thanks!

    Was this answer helpful?

    0 comments No comments
  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  4. Anonymous
    2010-12-08T22:12:02+00:00

    Thanks Mike, but unfortunately I don't understand what I'm supposed to do with the info you provided. Do I paste part of that into my code or into the password box?

    Was this answer helpful?

    0 comments No comments
  5. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more