autigers
Board Regular
- Joined
- Oct 9, 2005
- Messages
- 139
Is there a better way to set this code up ?
Code:
Private Sub Workbook_Open()
On Error GoTo TheEnd
Sheets("Config").Activate
If Environ("username") = ("ouaaye") Then
With Sheets("Config")
TheAns = FindColumn(.Name, Environ("username"))
ans = Cells(2, TheAns)
MsgBox "The password to access the VB environment is " & ans & " Figure you earned it !!"
End With
End If
If Environ("username") = ("OWNER") Then
With Sheets("Config")
TheAns = FindColumn(.Name, Environ("username"))
ans = Cells(2, TheAns)
MsgBox "The password to access the VB environment is " & ans & " :O)"
End With
End If
If Environ("username") = ("inakgr") Then
With Sheets("Config")
TheAns = FindColumn(.Name, Environ("username"))
ans = Cells(2, TheAns)
MsgBox "The password to access the VB environment is " & ans & " :O)"
End With
End If
If Environ("username") = ("appjcl") Then
With Sheets("Config")
TheAns = FindColumn(.Name, Environ("username"))
ans = Cells(2, TheAns)
MsgBox "The password to access the VB environment is " & ans & " :O)"
End With
End If
If Environ("username") = ("inabgi") Then
With Sheets("Config")
TheAns = FindColumn(.Name, Environ("username"))
ans = Cells(2, TheAns)
MsgBox "The password to access the VB environment is " & ans & " :O)"
End With
End If
Application.ScreenUpdating = False