Running a MACRO on a protected Excel tab

Northern NY Design

New Member
Joined
Sep 24, 2024
Messages
19
Office Version
  1. 365
Platform
  1. Windows
I have created buttons with attached MACROs to show each day of the week in a report based on which day I click. The problem I have is that I have each tab in the spreadsheet locked and when I try to run the MACROs with the tab locked, it gives me an error. What permissions do I need to click on or off when I protect the tab to allow the MACRO to run on a prtected tab?

Thank you.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
You cannot run code against protected worksheets.
What you would typically do is add code to the top of your procedure to first unprotect the tab, make your changes to it, and the re-protect it.

See here for examples of how to do this: Protect and Unprotect Sheet Using VBA
 
Upvote 0
Solution

Forum statistics

Threads
1,222,902
Messages
6,168,938
Members
452,227
Latest member
sam1121

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top