Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
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
Paste selected columns from worksheet in a workbook to anotherworkbook Orimslala Excel Discussion (Misc queries) 1 April 4th 08 02:40 AM
Test to see if a workbook is open Brettjg Excel Discussion (Misc queries) 1 March 5th 07 09:26 AM
If a worksheet name is = to test then a msgbox appears Vick Excel Discussion (Misc queries) 1 December 21st 05 11:17 PM
workbook update each time a new worksheet is selected DJL New Users to Excel 3 December 15th 05 01:48 PM
Update workbook each time a different worksheet is selected DJL New Users to Excel 2 December 15th 05 01:45 PM


All times are GMT +1. The time now is 12:11 PM.

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"