michaeltsmith93
Board Regular
- Joined
- Sep 29, 2016
- Messages
- 83
I'm using the following to convert Application.Username which is formatted "Last, First" to "First Last". For my name, it is working, but for a colleague it is not. I am baffled. The result for my colleague is "h, John Smith". I have had her select all and retype it, and it's still not working. Thoughts? I don't want to use Environ because it's variable at my company.
Code:
FullName = Application.UserName
FirstName = Right(FullName, InStr(1, FullName, " ", vbTextCompare) + 1)
LastName = Left(FullName, InStr(1, FullName, ",", vbTextCompare) - 1)
FirstLast = FirstName & " " & LastName