Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Log in userform
Hi all,
I have created a userform for my workbook that when you open the workbook the form appears. I am not sure how to have it so the worksheets stay hidden until a username and password is entered and the only display the worksheet(s) for that username. For example: username: user2 only displays worksheet titled "user2" while all other worksheets stay hidden. Or if it is easier, after the user logs in, a menu appears based on username for worksheets that are assessible to the individual user. I appreciate any help you can give me. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Log in userform
Hi
You can hide all sheets but one. So you could add an extra (blank) sheet which is visible when user open the workbook, then when user have submitted username and password, unhide coresponding sheet(s) and maybe hide initial sheet. Then in Workbook_Close event unhide initial sheet and hide all other sheets. Hopes this helps. .... Per "Mas" skrev i meddelelsen ... Hi all, I have created a userform for my workbook that when you open the workbook the form appears. I am not sure how to have it so the worksheets stay hidden until a username and password is entered and the only display the worksheet(s) for that username. For example: username: user2 only displays worksheet titled "user2" while all other worksheets stay hidden. Or if it is easier, after the user logs in, a menu appears based on username for worksheets that are assessible to the individual user. I appreciate any help you can give me. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Log in userform
I wouldn't use the workbook_beforeclose event.
The code would have to save the workbook to save these changes. And if the user made changes that shouldn't be saved, then the workbook could be damaged. Per Jessen wrote: Hi You can hide all sheets but one. So you could add an extra (blank) sheet which is visible when user open the workbook, then when user have submitted username and password, unhide coresponding sheet(s) and maybe hide initial sheet. Then in Workbook_Close event unhide initial sheet and hide all other sheets. Hopes this helps. ... Per "Mas" skrev i meddelelsen ... Hi all, I have created a userform for my workbook that when you open the workbook the form appears. I am not sure how to have it so the worksheets stay hidden until a username and password is entered and the only display the worksheet(s) for that username. For example: username: user2 only displays worksheet titled "user2" while all other worksheets stay hidden. Or if it is easier, after the user logs in, a menu appears based on username for worksheets that are assessible to the individual user. I appreciate any help you can give me. -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Log in userform
I'd use the workbook_Open or auto_open event to show the instruction/log sheet
that Per suggested--and hide the others. But that means that the users have to allow macros to run when they opened that workbook. If you're not sure that they'd do that, you could password protect the workbook and use another workbook to open this workbook. If macros are enabled, this helper/dummy workbook would use its macro to open the real workbook (and then close itself). If macros are not enabled, then this helper/dummy workbook would just show a worksheet that says that macros have to be enabled when this is opened. This is what the code in the dummy workbook could look like: Option Explicit Sub auto_open() Workbooks.Open Filename:="\\path\path\path\book2.xls", _ Password:="hithere" ThisWorkbook.Close savechanges:=False End Sub Mas wrote: Hi all, I have created a userform for my workbook that when you open the workbook the form appears. I am not sure how to have it so the worksheets stay hidden until a username and password is entered and the only display the worksheet(s) for that username. For example: username: user2 only displays worksheet titled "user2" while all other worksheets stay hidden. Or if it is easier, after the user logs in, a menu appears based on username for worksheets that are assessible to the individual user. I appreciate any help you can give me. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
fill userform textbox from userform listbox clik event | Excel Programming | |||
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) | Excel Programming | |||
Userform to enter values and shown in same userform in list | Excel Programming | |||
Looping procedure calls userform; how to exit loop (via userform button)? | Excel Programming | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming |