Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unprotecting worksheets with a macro

I have a workbook with multiple worksheets. Each sheet is
password protected. I need to be able to unprotect these
sheet with the click of a button. Is there a way to put
the password into the code so that it doesn't prompt every
time.


As a follow up question, do you know how I can accomplish
this for multiple files at the same time.

Thanks for your help,
Katrina
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unprotecting worksheets with a macro

You use the worksheet protect and unprotect:
you can attache this to a command button.

Worksheets("sheet1").Protect "david"
Worksheets("sheet1").Unprotect "david"


Hth

Charle

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Unprotecting worksheets with a macro

One way:

This will unprotect all the sheets in all open workbooks.

Public Sub MultipleUnProtect()
Const PWORD As String = "drowssap"
Dim wbBook As Workbook
Dim wsSheet As Worksheet
On Error Resume Next
For Each wbBook in Workbooks
For Each wsSheet in wbBook.Worksheets
wsSheet.Unprotect PWORD
Next wsSheet
Next wbBook
End Sub


In article ,
"Katrina" wrote:

I have a workbook with multiple worksheets. Each sheet is
password protected. I need to be able to unprotect these
sheet with the click of a button. Is there a way to put
the password into the code so that it doesn't prompt every
time.


As a follow up question, do you know how I can accomplish
this for multiple files at the same time.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unprotecting worksheets Lauren Excel Discussion (Misc queries) 2 January 28th 10 03:30 PM
Macro for protecting and unprotecting multiple worksheets saltnsnails Excel Discussion (Misc queries) 7 January 24th 08 10:49 PM
Unprotecting Worksheets Storm Excel Discussion (Misc queries) 3 August 29th 07 11:06 PM
Unprotecting worksheets hip Excel Worksheet Functions 4 June 5th 06 07:37 AM
Macro for unprotecting/protecting worksheets WITH passwords John Baker Excel Programming 2 July 7th 04 01:19 PM


All times are GMT +1. The time now is 08:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"