View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Macro for protecting and unprotecting multiple worksheets

Option Explicit
Sub UnprotectAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.unprotect password:="topsecret"
next wks
End Sub
Sub ProtectAll()
dim wks as worksheet
for each wks in activeworkbook.worksheets
wks.protect password:="topsecret"
next wks
End Sub



saltnsnails wrote:

I would say that I am a moderate user of Excel and I need some help with
running a Macro. I have a workbook that has about 60 pages in it that
several people have access to in order to edit information on each of the
sheets. Each sheet has a Vlookup table that I am constantly modifying to
keep items current. My problem is that I am unlocking worksheets all day
long. The password is the same on all of the sheets. Is there a simple
macro I can run to unlock the entire workbook rather than individually
unlocking each sheet? And the same thing when I am finished and putting the
file back. Can I run a macro to reassign the password protection on all of
the sheets in the workbook? Thanks!
--
-CRM


--

Dave Peterson