/ Published in: Visual Basic
This code enables the protection of the sheet with a password and then hides all the sheets.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Private Sub CommandButton_Click() Application.ScreenUpdating = False Dim wSheet As Worksheet Dim Pwd As String 'Pwd = InputBox("Enter your password to protect all worksheets", "Password Input") For Each wSheet In Worksheets wSheet.Protect Password:="EE" Next wSheet ActiveWindow.DisplayWorkbookTabs = False End Sub