Solved

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

Posted on 2013-11-24
5
311 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 45

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 45

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
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 …
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now