(SOLVED)Macro that returns user that is logged in ?

Jouve

New Member
Joined
Aug 10, 2006
Messages
19
i tried :

Code:
Range("A1").Select
ActiveCell.FormulaR1C1 = User

but apparently it doesn't work.

basically what i want is, if you log in to network/windows, you have some sort of username.

is this possible?

Thanks in advance.
 

Some videos you may like

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Jaafar Tribak

Well-known Member
Joined
Dec 5, 2002
Messages
7,984
Office Version
  1. 2016
Platform
  1. Windows
Hi,

Code:
Sub TEST()

    MsgBox Environ("USERNAME")

End Sub

Check the Environ VBA Method for more environement settings.

Regards.
 

Watch MrExcel Video

Forum statistics

Threads
1,113,986
Messages
5,545,347
Members
410,679
Latest member
rolandbianco
Top