Changing username

  • Thread starter Thread starter MauricioBR
  • Start date Start date
M

MauricioBR

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top