Protected sheet and macros

Jan Kalop

Active Member
Joined
Aug 3, 2012
Messages
389
I have protected worksheet without password and when I want run any one of many marcos on that sheet it dosen't allowe me because the sheet is protected.

Is there any way to keep worksheet protected and at the same time be able to run macros from that sheet?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Generally the best idea is in your macro, unprotect the sheet at the start of the macro and re-protect it again at the end of the macro. Could that work for you?
 
Upvote 0
yes that would be great, how this can be done?
The exact code would depend on exactly what protection you have on the sheet (eg password or no password, allowing or disallowing formatting, row insertion/deletion etc.)
Best way would be to turn on the macro recorder and then manually unprotect your sheet then re-protect it with the options you want then stop the macro recorder and look at the code.
 
Upvote 0
Solution
The exact code would depend on exactly what protection you have on the sheet (eg password or no password, allowing or disallowing formatting, row insertion/deletion etc.)
Best way would be to turn on the macro recorder and then manually unprotect your sheet then re-protect it with the options you want then stop the macro recorder and look at the code.
Thankyou very much solve the problem after few attempt
 
Upvote 0
You're welcome. Glad you were able to sort it out. :)
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,617
Members
449,039
Latest member
Mbone Mathonsi

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