Password Protect Active Sheets Issue

r0bism123

Board Regular
Joined
Feb 8, 2018
Messages
57
Hi Folks!

I am hoping someone can help me out. I have a workbook with 84 tabs which all tabs need to be password protected. I came up with the code below but then I realized that several of the tabs require various other formatting requirements other than AllowFormmattingRows:=True.

For example, I have some tabs that need AllowFormattingColumns:=True, AllowFormattingCells:=True, AllowEditObjects:=True and different combinations thereof. Is it possible to assign different formats to individual tabs versus assigning the same formats to all tabs in the workbook?

I've been messing around with it tonight and can't get it there. I appreciate the help!

Code:
Sub protect_all_sheets()
On Error GoTo fixpw
pass = InputBox("password")
For Each Worksheet In ActiveWorkbook.Worksheets
Worksheet.Protect Password:=pass, AllowFormattingRows:=True
Next
Exit Sub
fixpw: MsgBox "There is a problem - check your password, capslock, etc."
End Sub
 
Hi Fluff,

I got this figured out after I researched DrawingObjects. I really appreciate your help. This is going to save me so much time.

Thanks!
 
Upvote 0

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Glad you figured it out & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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