Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 763
  • Last Modified:

VBA protect unprotect worksheet syntax

Folks,
I would appreciate what the connect syntax is to protect and unprotect a worksheet using VBA. What I have below doesn't work.

    Worksheet("Menu").Protect Password:="123"

Open in new window

0
Frank Freese
Asked:
Frank Freese
  • 2
2 Solutions
 
jpaulinoCommented:
Is missing a "s" in the Worksheet ... it's Worksheets


Worksheets("Menu").Protect Password:="123"
0
 
jpaulinoCommented:
Then use the unprotect method for the oposite:

Worksheets("Menu").Unprotect Password:="123"
0
 
Frank FreeseAuthor Commented:
thank you
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now