Solved

Block access to only one worksheet in a workbook

Posted on 2012-04-04
6
145 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
6 Comments
 
LVL 48

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 48

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

695 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