T
tinman
Hello,
Could someone help me understand why it doesn't like "If cUser =
"XJOHN" Or "YPAUL" Then" in the macro below? Thanks.
Sub UnprotectAllSheets()
Dim cUser As String
cUser = UCase(Environ("username")) 'change to uppercase because
this seems to be case sensitive.
If cUser = "XJOHN" Or "YPAUL" Then
Dim wSheet As Worksheet
For Each wSheet In ActiveWorkbook.Worksheets
wSheet.Unprotect Password:="opensesame"
Next
Else
UserForm1.Show
End If
End Sub
Could someone help me understand why it doesn't like "If cUser =
"XJOHN" Or "YPAUL" Then" in the macro below? Thanks.
Sub UnprotectAllSheets()
Dim cUser As String
cUser = UCase(Environ("username")) 'change to uppercase because
this seems to be case sensitive.
If cUser = "XJOHN" Or "YPAUL" Then
Dim wSheet As Worksheet
For Each wSheet In ActiveWorkbook.Worksheets
wSheet.Unprotect Password:="opensesame"
Next
Else
UserForm1.Show
End If
End Sub