PDA

View Full Version : Solved: Password Protect Excel 2007 Workbook



Sam1015
08-10-2010, 06:48 AM
Hello,

I created a large workbook with approximately 20 different worksheets. Thus, I have been trying to no success to password protect the entire workbook except a single specific worksheet called "Inputs." My goal was to password protect all the sheets except this "Inputs" Sheet. I was attempting to have a prompt requesting a password if user attempts to change any of the protected sheets.

Any help would be greatly appreciate.

thank you!

austenr
08-10-2010, 08:25 AM
Does this help?

http://www.online-tech-tips.com/ms-office-tips/the-password-you-can-always-remember/

Sam1015
08-10-2010, 08:32 AM
thanks for reply. Yeh that works except my goal is to just have a code that protects all worksheets excluding one (specified in code). I know I can individually protect each worksheet without using vba, but I foresee the workbook growing to approximately 30-40 worksheets and was hoping to forego the lengthy process of protecting each and every one.

I appreciate the effort.

Paul_Hossler
08-10-2010, 02:39 PM
Something simple like this, but you can make it as elaborate as needed


Sub Prod()

Dim ws As Worksheet

For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "LeaveAlone" Then ws.Protect
Next

End Sub



I usually have a pair of macros to unprotect/unhide, configure sheets, etc for Production and for Development


Paul

Sam1015
08-11-2010, 08:40 AM
Thanks Paul!!