protecting Multiple Sheets

G

Guest

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
 
G

George Hepworth

This forum is for questions about MS Access, not MS Excel. Your question
might get answered more quickly if you post it in a forum devoted to Excel
questions.

George
 
D

Douglas J. Steele

Sorry, this newsgroup is for questions about Access, the database product
that's part of Office Professional.

I'd recommending reposting your question to a newsgroup related to Excel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top