Running a MACRO on a protected Excel tab

Northern NY Design

New Member
Joined
Sep 24, 2024
Messages
25
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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
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
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

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