Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unprotecting worksheets | Excel Discussion (Misc queries) | |||
Macro for protecting and unprotecting multiple worksheets | Excel Discussion (Misc queries) | |||
Unprotecting Worksheets | Excel Discussion (Misc queries) | |||
Unprotecting worksheets | Excel Worksheet Functions | |||
Macro for unprotecting/protecting worksheets WITH passwords | Excel Programming |