I want to protect all my sheets in a workbook but it takes me very long to
apply password on individual worksheets. I have more than 180 worksheets in
my workbook. I want to make all my sheets read only/hidden formulas and
protected by password so that no body can change unless provides correct
password.
Kindly help because i really need this. Thanks.
The following macro cycless through all the worksheets in the active
workbook, protecting them and assigning the password of quot;Passwordquot;
Sub ProtectAll()
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ActiveWorkbook
For Each ws In wb.Worksheets
ws.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True, _
Password:=quot;Passwordquot;
Next ws
Set wb = Nothing
Set ws = Nothing
End Sub
Place it in a VBA module by pressing Alt F11, click INSERT on the menu and
select MODULE. You can either type the code above or cut and paste it. To
run the macro select TOOLS on the menu, click MACRO and then select MACROS.
The macro will be in the list of available macros. You can select it and
then click the RUN command button.
--
Kevin Backmannquot;Kashif Sattarquot; wrote:
gt; I want to protect all my sheets in a workbook but it takes me very long to
gt; apply password on individual worksheets. I have more than 180 worksheets in
gt; my workbook. I want to make all my sheets read only/hidden formulas and
gt; protected by password so that no body can change unless provides correct
gt; password.
gt;
gt; Kindly help because i really need this. Thanks.
- Sep 23 Tue 2008 20:46
how to protect multiple worksheets simultaneouslly and not one by
close
全站熱搜
留言列表
發表留言