VBA User Information Msgbox

Pinaceous

Well-known Member
Joined
Jun 11, 2014
Messages
1,109
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I'm using an excel sheet that can be accessed by many users.

When each user opens their excel document, in the top right hand side of the screen appears the user's name.

My question is, could I launch a msgbox popup to include the name of the user who is signed in in a message box popup?

For example, an employee named Bob Parker is signed into their excel document as Parker, Bob.

Could a msgbox would be designed to include the user's name?

For example:
VBA Code:
 Msgbox " [Username] Hello!"
would appear
"Bob Parker Hello!"
when run.

Is this possible?

Please let me know when you get a chance.

Thank you,
pinaceous
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Try this.
VBA Code:
MsgBox Application.UserName & " Hello!"
 
Upvote 0
Hi Norie,

The way that the administrator setup the excel, that approach did not work.

The message box pops back authorized user in place of the application.username.

Is there any additional information that I could provide to help you?

Thank you,
pinaceous
 
Upvote 0
You could try using Environ("Username") instead.
 
Upvote 0
Could you please give me an example in a code?
 
Upvote 0
All you need to do is replace Application.UserName.
VBA Code:
MsgBox Environ("UserName") & " Hello!"
 
Upvote 0
All you need to do is replace Application.UserName.
VBA Code:
MsgBox Environ("UserName") & " Hello!"
Okay I see. Thank you for explaining that via code. Let me try it a go. ✌
 
Upvote 0
Hi Norie,

It does work but it displays the employees code that is assigned to each individual in using the code from Post#7.

Is there some other code that we can try to isolate the name, which is signed into the excel sheet?

Thank you,
pinaceous
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,435
Members
448,961
Latest member
nzskater

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