• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 151
  • Last Modified:

Block access to only one worksheet in a workbook

I have a workbook that includes about 15 worksheets. I need to block access to individual worksheets using different passwords for each worksheet.
0
mhalciati
Asked:
mhalciati
  • 2
  • 2
1 Solution
 
Martin LissOlder than dirtCommented:
Here's a VBA solution.
0
 
mhalciatiAuthor Commented:
I get a syntax error on

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
0
 
mhalciatiAuthor Commented:
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
 
Martin LissOlder than dirtCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now