Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I test when any worksheet within a workbook is selected
Hi
Is there a function out there to do this? Reason: I want to restrict groups of users so they can only see the sheets that are relevant to their job. If they move to a sheet they are restricted from seeing I want to make it invisible and return them to a sheet that all users can access. I can do this if I put code into each worksheet but was hoping there might be a more central way of doing it. Peter |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I test when any worksheet within a workbook is selected
Here’s what I’m thinking:
You could use something like this: Private Sub Workbook_Open() pwd = InputBox("Please enter password.") If pwd = "secret" Then Worksheets(2).Visible = -1 Else Worksheets(2).Visible = 2 End If End Sub Which will ask for a password when the file is opened and based on tha password you could have a series of ElseIf statements asking for th various passwords. Setting .Visible = 2 makes the Sheet “Very Hidden and no one will be able to tell it’s even there and setting it to – makes it visible. You could then go to Tools-VBAProject Properties i the VBA Editor and lock the project for viewing and protect that with password. I’m sure you could create your own form with a password field tha masks input, but the rest of this could be perfect for what you want -- Message posted from http://www.ExcelForum.com |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I test when any worksheet within a workbook is selected
Hi
Thanks but it's not what I am after. When any worksheet within a workbook is activated I would like to be able to trap which one it is and if necessary make the visible property = false. Note: I am using the username to determine who is able to see what sheet. I have about 10 worksheets that I want to be able to control in this way (and about 400 workbooks). Peter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Paste selected columns from worksheet in a workbook to anotherworkbook | Excel Discussion (Misc queries) | |||
Test to see if a workbook is open | Excel Discussion (Misc queries) | |||
If a worksheet name is = to test then a msgbox appears | Excel Discussion (Misc queries) | |||
workbook update each time a new worksheet is selected | New Users to Excel | |||
Update workbook each time a different worksheet is selected | New Users to Excel |