Jenna_B
New Member
- Joined
- Sep 22, 2016
- Messages
- 28
- Office Version
- 365
- Platform
- Windows
I want to control how my workbook opens based on username. I have it working for one username but would like it to work for more than one username. My base code is below. Any help is much appreciated.
Code:
Private Sub Auto_Open()
Select Case Environ("username")
Case Is = "tsmith"
On Error Resume Next
ActiveWorkbook.Unprotect ("password")
Sheets("sheet1").Visible = True
Sheets("sheet2").Visible = True
Sheets("Sheet3").Visible = True
Sheets("sheet4").Visible = True
End Select
End Sub