Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a similar situation as George, but I want the user to be able to open
multiple worksheets and have all the rest of the worksheets remain hidden. The code I currently have only has worksheet1 visible and prompts for a username and password. If they enter the correct username/password, it will unhide one worksheet, but not multiple sheets. If the enter an incorrect username/password, it gives them an error stating "you do have the authorization to view this worksheet." Any suggestions? Thank you! "BSc Chem Eng Rick" wrote: George, You can do this with some VB code in the WORKBOOK OBJECT. Here is a sample, when the workbook is opened only Sheet1 is visible until a name that matches a defined case is entered. Then that specific worksheet is made visible. When you close the workbook, all the sheets are again hidden expect for Sheet1. Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim i As Integer Worksheets(1).Visible = -1 For i = 2 To Worksheets.Count Worksheets(i).Visible = 2 Next i End Sub Private Sub Workbook_Open() Dim Name As String Name = Application.InputBox("Please Enter Password", Type:=2) Select Case Name Case "John" Worksheets(2).Visible = -1 Worksheets(1).Visible = 2 Case "Susan" Worksheets(3).Visible = -1 Worksheets(1).Visible = 2 End Select End Sub -- If this helps, please click "Yes" <<<<<<<<<<< "George" wrote: This is what I want to do I have a workbook with multiple sheets in it 15 to 20 with a master sheet to add up all the data The workbook needs to be viewed by several people but I only want each person seeing the data for their page. Is there a way to blank out the worksheet then be able to see it if you have the password. I do realize that you can just have multiple workbooks with the workbooks linked but they are in buildings around the country and you can't link workbooks with office live workspace. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
merge multiple worksheets from multiple excel files into oneworksheet | Excel Discussion (Misc queries) | |||
Need Simple List...Multiple Columns and Multiple Worksheets | Excel Worksheet Functions | |||
how to make a macro to clear multiple cells from multiple worksheets? | Excel Worksheet Functions | |||
Delete Blank Rows Code - Multiple Worksheets - Multiple Documents | Excel Discussion (Misc queries) | |||
Updating multiple graphs in multiple worksheets at the same time | Excel Discussion (Misc queries) |