View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Susan Susan is offline
external usenet poster
 
Posts: 271
Default Protecting Multiple Sheets

I am right clicking on the worksheet tab and clicking on view code and then
entering the code, then go to the worksheet and click on macors and run the
macro using version 2003, am i putting it in the wrong area?

"John Bundy" wrote:

I copy and pasted your exact code and it works, even tried with 100 sheets.
Where are you putting your code and what version?
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"SUSAN" wrote:

I entered the following code

Sub ProtectAll()

Dim wSheet As Worksheet
Dim Pwd As String

Pwd = InputBox("Enter your password to protect all worksheets",
"Password Input")
For Each wSheet In Worksheets
wSheet.Protect Password:=Pwd
Next wSheet

End Sub




But when i run the code i get an error and all it says is "400", can someone
hep me, i am trying to protect 52 sheets at one time

Thanks