Does anyone know how to add the login name to a cell in excel.
I am actually wanting to add it to a database, but figure that if I can find the code to add it to excel then the rest should be relatively easy.
Here is what I am using so far with no luck of it working.
Private Sub Workbook_Open()
If [G6].Value <> "" Then Exit Sub
[G6].Value = EnvironUserName() End Sub
It examines cell g6 on open and if it is blank I would like it to read the login name of the person opening the workbook or sheet.
If anyone has some ideas or thoughts they would be greatly appreciated.
Thanks In Advance,
I am actually wanting to add it to a database, but figure that if I can find the code to add it to excel then the rest should be relatively easy.
Here is what I am using so far with no luck of it working.
Private Sub Workbook_Open()
If [G6].Value <> "" Then Exit Sub
[G6].Value = EnvironUserName() End Sub
It examines cell g6 on open and if it is blank I would like it to read the login name of the person opening the workbook or sheet.
If anyone has some ideas or thoughts they would be greatly appreciated.
Thanks In Advance,