Hi
I want to user name case match then End Sub please tell me how to do this
I want to user name case match then End Sub please tell me how to do this
Code:
Private Sub Workbook_Open()
'the name of the current user
Dim UserName As String
'on opening, find out who this is (and convert to lower case)
UserName = LCase(Environ("UserName"))
'if this is one of two specified Wise Owls ...
Select Case UserName
Case "geena.davis", "susan.sarandon"
'display a greeting and change default cell colour
MsgBox "Hello, Thelma/Louise"
Styles("Normal").Interior.Color = RGB(240, 255, 255)
Case Else
'otherwise, just continue
End Select
End Sub