View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Simple workbook Protect

Sub ProtectAllSheets()
For Each Shts In ThisWorkbook.Worksheets
Shts.Protect Password:="ABCDEFGH"
Next
End Sub

If this post helps click Yes
---------------
Jacob Skaria


"LiAD" wrote:

morning,

could some-one please give me a very simple code for unprotecting and then
reprotecting an entire workbook (it contains three sheets)? I am looking for
a code to replace the protect sheet version of

Sheets("UP4 Données").Unprotect Password:="ABCDEFGH"

to the workbook version.

I have other code driven by macro buttons which I will put in between the
unprotect and protect codes just for reference.

Thanks
LiAD