Solved

Window user name from Excel VBA

Posted on 2014-01-27
1
297 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 45

Accepted Solution

by:
Martin Liss earned 200 total points
Comment Utility
Will this do?

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now