Thread: Log in userform
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default 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