Get User name from an Excel login

Asked

Viewed 405 times

0

Good afternoon. I have a login in excel that generates a log of Users. I can put in a worksheet cell the name of who logged in, but when another user logs in, the name of the previous user also changes. I need every record to keep the name of the person who logged in when making that record. How to resolve this ??

  • 1

    you can post the code you have to register to make it easier for someone to help.

  • I believe you could create a hidden tab where you insert each record line! You check the last line and enter the user login on the next line

1 answer

0

Hey, that depends on. From what I understand, you log in to a cell, but want the next logins to be stored, for example, in the cells below, without risk of overlapping from the previous login. Correct? When storing the login in a cell, for example: A1 of sheet 1, the next login must be stored in A2, and the next on A3, so on. If each login is already stored in a variable (recommend), I would do the following:

Sheets(1).Range("A1000000").End(xlUp).Offset(1, 0).Value = login

Addendum: If you want to know the date and time of login, also include this line:

Sheets(1).Range("A1000000").End(xlUp).Offset(0, 1).Value = Now()

This code gives you autonomy of up to 1 million records and I performed based on a variable called "login", but you should rename it to the variable of your code, in addition to the references. I’m sorry if I didn’t get it right, but it made sense to you?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.