Link to home
Start Free TrialLog in
Avatar of mhalciati
mhalciatiFlag for United States of America

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of Martin Liss
Martin Liss
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mhalciati

ASKER

I get a syntax error on

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
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?
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.