Your technology certification is waiting. Enroll in Cloud Class ®
Const myPassword = "password"
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim wkb As Workbook
Dim wks As Worksheet
Set wkb = ThisWorkbook
For Each wks In wkb.Worksheets
Select Case UCase(wks.Name):
Case "1-20 LABELS", "BLANK LABELS": 'exclude those in this list - put ALL IN UPPER CASE = CHECK SPACES AND SPELLING!!!
'do nothing to these sheets
Case "LABOR", "ROSTER", "CONVERTER", "INPUT 1-20", "INPUT 21-40": 'one sheet name per quotation marks
'put any different worksheet protection code, here
wks.Protect Password:=myPassword, AllowFiltering:=True
Case "finallyOne more sheet", "other sheet", "that get the same protection": 'one sheet name per quotation marks
'for future use, if you want different type of protection
'put any different (from the above) worksheet protection code, here
Case Else: 'all others, just do this protect approach
wks.Protect DrawingObjects:=False, Contents:=True, Scenarios:=False, AllowFormattingCells:=True
Open in new window
Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.