Solved

Window user name from Excel VBA

Posted on 2014-01-27
1
299 Views
Last Modified: 2014-01-27
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?
0
Comment
Question by:jjxia2001
1 Comment
 
LVL 46

Accepted Solution

by:
Martin Liss earned 200 total points
ID: 39812633
Will this do?

Range("UserID") = lCase(strUser) ' or UCase(strUser)
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question