Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto_Open Macro
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Auto_Open Macro
Hi Bob,
This worked very well. Thank you for your assistance. Martin "Bob Phillips" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Auto_open and more.... | New Users to Excel | |||
Can I make an Auto_open macro conditional? | Excel Discussion (Misc queries) | |||
Force read-only in auto_open macro | Excel Discussion (Misc queries) | |||
Auto_open | Excel Discussion (Misc queries) | |||
Help with 'Auto_Open' please... | Excel Discussion (Misc queries) |