Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Window user name from Excel VBA

Posted on 2014-01-27
1
Medium Priority
?
306 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 49

Accepted Solution

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

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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

971 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