ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Username upon Entry (https://www.excelbanter.com/excel-worksheet-functions/191548-username-upon-entry.html)

NPell

Username upon Entry
 
Hello,

I am trying to create a way of logging a persons XP Username when they
put a cell value in a specific cell.

For Example;
User puts "X" in Cell A1, their username is returned in B1.

Thanks if you can help.

Rick Rothstein \(MVP - VB\)[_700_]

Username upon Entry
 
Perhaps this worksheet Change event code will do what you want. Right-click
the tab for the worksheet you want this functionality and select View Code
from the popup menu that appears. This will take you into the Visual Basic
editor and automatically open the code window for the sheet whose tab you
right-clicked on. Copy/Paste the following into that code window...

Private Sub Worksheet_Change(ByVal Target As Range)
Dim C As Range
If Target.Column = 1 Then
For Each C In Target
C.Offset(0, 1).Value = Environ("USERNAME")
Next
End If
End Sub

Any changes made in Column A (including deleting an entry) will put the
username in the same row in Column B.

Rick



"NPell" wrote in message
...
Hello,

I am trying to create a way of logging a persons XP Username when they
put a cell value in a specific cell.

For Example;
User puts "X" in Cell A1, their username is returned in B1.

Thanks if you can help.




All times are GMT +1. The time now is 10:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com