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

Posted on 2013-11-24
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?
Question by:brothertruffle880
  • 2
  • 2
LVL 46

Accepted Solution

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

For Each sht In Worksheets

End Sub

Open in new window


Expert Comment

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

Author Comment

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

Author Closing Comment

ID: 39674210
Thank you Martin.  Works perfectly.
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

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