The marked line looks for TESTER+anything as a user id and exits if it does not start with it (actually "TESTER" in the first 6 char), allowing the workbook to open
Option Explicit
Private Sub Workbook_Open()
Dim sUserName As String
sUserName = UCase(Environ("USERNAME"))
'uncomment out for testing
'sUserName = "TESTER1"
If Left(sUserName, 6) <> "TESTER" Then Exit Sub ' <--------------------------------------
Call MsgBox("SORRY!!!" & vbCrLf & vbCrLf & "But 'Tester' logons are not allow to use this" & _
vbCrLf & vbCrLf & "The workbook will now close", _
vbCritical + vbOKOnly, "Tester Check")
ThisWorkbook.Close (False)
End Sub
If you change it to
If Left(sUserName, 4) <> "TEST" Then Exit Sub
then it will allow the workbook to open if the first 4 char of user id are not TEST
Did you want TEST1 to be allowed to use it, but TESTERxx not?
Another way to look at it is to not use the Exit Sub and just a If / Then
Option Explicit
Private Sub Workbook_Open()
Dim sUserName As String
sUserName = UCase(Environ("USERNAME"))
'uncomment out for testing
sUserName = "TEST1"
If Left(sUserName, 4) = "TEST" Then
Call MsgBox("SORRY!!!" & vbCrLf & vbCrLf & "But 'Tester' logons are not allow to use this" & _
vbCrLf & vbCrLf & "The workbook will now close", _
vbCritical + vbOKOnly, "Tester Check")
ThisWorkbook.Close (False)
End If
End Sub