View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Henk Frigge[_2_] Henk Frigge[_2_] is offline
external usenet poster
 
Posts: 9
Default Protect multiple sheets in one time

tHENKs Dominic

This one is working perfectly too!

"dominicb" wrote:


Good morning Henk Frigge

This code will do what you're asking.

Sub ProtSheets()
For Each WkSht In Worksheets
WkSht.Protect password:="password"
Next WkSht
End Sub

Note that for simplicity I have omitted some of the optional settings
that can be used in th third "Protect" line. (In XL2000
(DrawingObjects:=True, Contents:=True, Scenarios:=True but in XL
2002/2003 around a dozen other optional settings)

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=383063