I pulled your answer from URL listed below, second and third post both
give different approaches depending on your needs. Below protects and
unprotects all sheets, if you just need one sheet there are other
options in the following URL.

http://www.ozgrid.com/forum/showthread.php?t=20766&page=1

Dim ws As Worksheet
Sub ProtectAll()

For Each ws In Worksheets
ws.Protect Password:="anystring"
Next
End Sub

Sub UnProtectAll()
For Each ws In Worksheets
ws.Unprotect Password:="anystring"
Next

End Sub

On Apr 15, 7:51 am, Rajesh K R <rajeshkainikk...@gmail.com> wrote:
> Hi Experts,
>
> I want to password protect my work sheets, but the same time it is
> necessary to unprotect it for the running of macro so i have to give a
> code to unprotect them. how can I do it.
>
> Regards
>
> Rajesh kainikkara

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to