Auto_Open Macro

G

Guest

Can I creat a Macro to prompt a user to enter their name which would then
propogate to the "Username" value on the General Tab under Tools\Options menu?

I have several users accessing the file from various computers and Windows
login.
I know there is a way to update the username using VBasic to cooincide with
the Windows log in but I am not familiar enough with VB to do it.

If I could record a macro and save it as Auto_open this would work. I also
do not want the Tools\Options\General window to be displayed wen the macro
runs. I just want the username to be updated based on the information entered
in the prompt window.

Thanks
Martin
 
B

Bob Phillips

No need to prompt


Private Sub Workbook_Open()
Application.UserName = Environ("UserName")
End Sub

'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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

Top