Solved

Block access to only one worksheet in a workbook

Posted on 2012-04-04
6
139 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 45

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 45

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now