User's login or LanID

Jornyboy

Board Regular
Joined
Jul 31, 2004
Messages
130
Eh oh all!

What command could I use in Excel to capture the User's login or LanID?

I know this is possible but i Cant seem to be able to find it in the help for VBA

Kind Regards

John.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
for user name

Sub Button2_Click()
Dim strUserName As String
strUserName = Environ("username")
MsgBox (strUserName)
End Sub

for computer name

Sub Button1_Click()
Dim strUserName As String
strUserName = Environ("computername")
MsgBox (strUserName)
End Sub

Hope that helps
Regards
Asim
 
Upvote 0

Forum statistics

Threads
1,216,235
Messages
6,129,650
Members
449,524
Latest member
RAmraj R

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top