Solved

Block access to only one worksheet in a workbook

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

911 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

27 Experts available now in Live!

Get 1:1 Help Now