Solved

VBA protect unprotect worksheet syntax

Posted on 2014-03-20
3
696 Views
Last Modified: 2014-03-20
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
Comment
Question by:Frank Freese
  • 2
3 Comments
 
LVL 48

Assisted Solution

by:jpaulino
jpaulino earned 500 total points
ID: 39943862
Is missing a "s" in the Worksheet ... it's Worksheets


Worksheets("Menu").Protect Password:="123"
0
 
LVL 48

Accepted Solution

by:
jpaulino earned 500 total points
ID: 39943866
Then use the unprotect method for the oposite:

Worksheets("Menu").Unprotect Password:="123"
0
 

Author Closing Comment

by:Frank Freese
ID: 39943903
thank you
0

Featured Post

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question