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

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Glad you figured it out & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,472
Messages
6,125,005
Members
449,203
Latest member
Daymo66

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