Solved

Block access to only one worksheet in a workbook

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel formula Sumif not working 4 28
Excel Spacing Anomaly 4 24
Excel Calculate Average - Grouped Values 7 23
If a cell in a range equals "YES" return specific Test. 4 33
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
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 how to use longer labels with horizontal bar charts instead of the vertical column chart.

831 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