Window user name from Excel VBA

I used the following code to get my window login ID:

        Dim strUser As String
        strUser = GetWindowsUserName
        Range("UserID") = strUser

"strUser" is sometimes upper case and sometimes lower case.  Is there anyway I can control this?
jjxia2001Asked:
Who is Participating?
 
Martin LissConnect With a Mentor Older than dirtCommented:
Will this do?

Range("UserID") = lCase(strUser) ' or UCase(strUser)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.