- Sep 22, 2016
- Office Version
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.
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