MrExcel Publishing
Your One Stop for Excel Tips & Solutions

To Juan Pablo

Posted by Tony on October 10, 2001 8:37 AM

I wish to thank you for your answer to my problem concerning inserting additional rows in an unlocked area of a protected sheet.
Could I please ask for your further asistance? My workbook consist of 10 sheets; 8 of which have a different password for each sheet. Each sheet is simular in design, but provides for the entering of data from different forest ranger districts. Each sheet is procted, with an unlocked area for entering data.
Will you please show me how I can use the macro you included in your answer to my message so as that additional rows can be inserted in an individual protected sheet as needed.
Again, thank you for your kind assistance. /Tony

Posted by Juan Pablo on October 10, 2001 8:50 AM

This will Protect each Sheet with a different password (PWD1 for Sheet1, PWD2 for Sheet2, etc.)

Private Sub Workbook_Open()
For Each Sht In ActiveWorkbook.Sheets
Sht.Protect _
password:=Choose(Sht.Index, "PWD1", "PWD2", "PWD3", "PWD4", "PWD5", "PWD6", "PWD7", "PWD8", "PWD9", "PWD10"), _
DrawingObjects:=True, _
Contents:=True, _
Scenarios:=True, _
Next Sht
End Sub

Juan Pablo

Posted by Tony on October 10, 2001 1:41 PM

Again. Thank you thank you thank you.