Hi Team,
Please note I am trying to put in place a welcome message in userform (label) but the application username needs to be restricted to only show the Name of the user ( That it is after the coma)
The code is working correct but unfortunately I need to extract only the value after the "," that application. Username generates
This needs to be dynamic since usernames can be larger or smaller but imagine a user that his name is Mata Oviedo , Carlos so the value to extract is "Carlos" (since it is after the coma)
Hope this can be clear for you
Please note I am trying to put in place a welcome message in userform (label) but the application username needs to be restricted to only show the Name of the user ( That it is after the coma)
The code is working correct but unfortunately I need to extract only the value after the "," that application. Username generates
This needs to be dynamic since usernames can be larger or smaller but imagine a user that his name is Mata Oviedo , Carlos so the value to extract is "Carlos" (since it is after the coma)
VBA Code:
Private Sub Workbook_Open()
If Hour(Now) > 12 Then
UserForm1.Hello.Caption = " Good Afternoon " & [B]Application.UserName[/B]
ElseIf Hour(Now) < 12 Then
UserForm1.Hello.Caption = " Good Morning " & [B]Application.UserName[/B]
End If
UserForm1.Show
Hope this can be clear for you