Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Mas Mas is offline
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fill userform textbox from userform listbox clik event GregJG[_21_] Excel Programming 3 December 7th 08 04:47 PM
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) Corey Excel Programming 2 January 9th 07 01:01 PM
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM


All times are GMT +1. The time now is 01:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"