ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Changing username (https://www.excelbanter.com/excel-discussion-misc-queries/176059-changing-username.html)

MauricioBR

Changing username
 
Hello,
I'd like to change the excel´s username (Tools/Options/Username) with the
username of the windows (Documents Settings) just after opening the worksheet.

Someone could help me with this vba code?

Best regards
Mauricio BR

John Bundy

Changing username
 
If i understand you correctly, that you want to change the workbook username
to the name stored in the system for the current user, use this in the
worksheet open event.

Private Sub Workbook_Open()
Application.UserName = Environ("UserName")
End Sub
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"MauricioBR" wrote:

Hello,
I'd like to change the excel´s username (Tools/Options/Username) with the
username of the windows (Documents Settings) just after opening the worksheet.

Someone could help me with this vba code?

Best regards
Mauricio BR


MauricioBR

Changing username
 
That worked!
Thanks

"John Bundy" escreveu:

If i understand you correctly, that you want to change the workbook username
to the name stored in the system for the current user, use this in the
worksheet open event.

Private Sub Workbook_Open()
Application.UserName = Environ("UserName")
End Sub
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"MauricioBR" wrote:

Hello,
I'd like to change the excel´s username (Tools/Options/Username) with the
username of the windows (Documents Settings) just after opening the worksheet.

Someone could help me with this vba code?

Best regards
Mauricio BR



All times are GMT +1. The time now is 06:27 PM.

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