Solved

Block access to only one worksheet in a workbook

Posted on 2012-04-04
6
143 Views
Last Modified: 2013-07-23
I have a workbook that includes about 15 worksheets. I need to block access to individual worksheets using different passwords for each worksheet.
0
Comment
Question by:mhalciati
  • 2
  • 2
6 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 37806042
Here's a VBA solution.
0
 

Author Comment

by:mhalciati
ID: 37806144
I get a syntax error on

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
0
 

Author Comment

by:mhalciati
ID: 37806200
Also, I'd like to make sure the workbook ALWAYS opens to sheet 1. I have named the sheets, so in the syntax I am using the name rather than sheet1, sheet2, etc. Is that correct?
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 37806310
Yes the CodeName is the name in parenthesis. For example Sheet1(Budget) where 'Budget' is the CodeName.

Open a new workbook and go to ThisWorkBook -> WorkBook -> Workbook_SheetActivate event in the IDE. Is it different than Private Sub Workbook_SheetActivate(ByVal Sh As Object). If it is you can use CodeName rather than Sh.CodeName in your code.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
assignment of laptops - risks 6 49
SKip past fields with no data 6 15
List Box Entries Excel 2010 5 31
Slow calculation 2 15
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question