Use this in the workbook module only
Code:Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim wks As Worksheet For Each wks In ThisWorkbook.Worksheets wks.Protect "passwordhere" Next wks If Not Cancel Then Me.Save End If End Sub
Use this in the workbook module only
Code:Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim wks As Worksheet For Each wks In ThisWorkbook.Worksheets wks.Protect "passwordhere" Next wks If Not Cancel Then Me.Save End If End Sub
A dream is not something you see when you are asleep, but something you strive for when you are awake.
It's usually a bad idea to say that something can't be done.
The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve
Join us at Facebook
Bookmarks