Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
If you hide all but the summary sheets and protect the workbook with a
password, you can then put in a auto_open macro to prompt for a password and unhide sheets based on the response. You would also need a auto_close macro to hide all of the sheets again for the next user. You can get much fancier and do a custom form that uses password characters, but that gets more involved. In this simple version if the user hit cancel or enters an unrecognized password no sheets will be unhidden. For added security protect the VBA project so no one can get to the code and find the workbook password. Something like this: Sub Auto_Open() x = InputBox("Enter Dept Password") ActiveWorkbook.Unprotect Password:="password" If x = "accounting1" Then Sheets("Sheet1").Visible = True 'ADD OTHER CONDITIONS ActiveWorkbook.Protect Password:="password", Structu=True, Windows:=False End Sub Sub Auto_Close() ActiveWorkbook.Unprotect Password:="password" Sheets("Sheet1").Visible = False 'ADD OTHER SHEETS ActiveWorkbook.Protect Password:="password", Structu=True, Windows:=False End Sub -- If this helps, please remember to click yes. "kefee85" wrote: I have a workbook consisting of 14 separate worksheets. I would like for each department to be able to access only their individual worksheet and two summary worksheets, but not be able to view the other worksheets. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Prompt for protection password when not trying to access VBA | Excel Discussion (Misc queries) | |||
Password protection | Excel Discussion (Misc queries) | |||
Password Protection | Excel Discussion (Misc queries) | |||
Password Protection | Excel Discussion (Misc queries) | |||
Password Protection | Excel Discussion (Misc queries) |