Solved

Window user name from Excel VBA

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Web Query 1 24
Transposing this formula ... 5 15
Import text from rows into columns? 12 43
Shape manipulation in Excel 2 18
Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
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…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

830 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