Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Hi Experts,
I need a code to protect all the sheets in a workbook dynamically. i may add sheets or delete sheets but protection of the sheets should be dynamic. thanks in advance. |
#2
![]() |
|||
|
|||
![]() Quote:
Sub ProtectAllSheets() 'Protects ALL worksheets For Each Shts In ThisWorkbook.Worksheets Shts.Protect Password:=secret Next End Sub. if you are using excel 2007 version, copy this code to .xlsm (macro enabled) or excel 2003 you can directly copy to .xls spread sheet. all the best
__________________
Thanks Bala |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Moving worksheets to another book - 2nd book will not appear | Excel Discussion (Misc queries) | |||
copy worksheets to new book without linking to original book | Excel Discussion (Misc queries) | |||
protect worksheet/book | Excel Worksheet Functions | |||
how do I protect formula's only, not entire sheet or book? | Setting up and Configuration of Excel | |||
Can I protect a range of worksheets in a book with one action? | Excel Worksheet Functions |