Thread: Auto_Open Macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Auto_Open Macro

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)

"Trying to Excel" wrote in message
...
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