Solved

Excel VBA - Removing worksheet passwords from a group in one workbook

Posted on 2013-11-24
5
339 Views
Last Modified: 2013-11-25
I have a workbook with an ever-changing number of worksheets (between 2 and 8).  Each worksheet has its own password and as soon I open the workbook up, I'd like to be prompted to unprotect each of the sheets.
Can someone help me code this?
0
Comment
Question by:brothertruffle880
  • 2
  • 2
5 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 39673490
Private Sub Workbook_Open()
Dim sht As Worksheet

For Each sht In Worksheets
    sht.Unprotect
Next

End Sub

Open in new window

0
 
LVL 4

Expert Comment

by:yuppydu
ID: 39673911
Every sheet has a different password, or they are just protected?
0
 

Author Comment

by:brothertruffle880
ID: 39674011
Each sheet has its own password.  The Jan sheet has password "January", The feb sheet has "february", etc.
0
 

Author Closing Comment

by:brothertruffle880
ID: 39674210
Thank you Martin.  Works perfectly.
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39674966
You're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
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.

838 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