Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

vba

ResolvedVersion 2003

Jeffrey has attended:
Excel VBA Intro Intermediate course
Excel VBA Intro Intermediate course
Excel VBA Intro Intermediate course

VBA

How do you password protect a sheet in VBA?

RE: VBA

Jeffrey

To Protect a sheet

Sub ProtectSheet()
Dim Password
Password = "test"
ActiveSheet.Protect Password, True, True, True
End Sub

and to un-protect

Sub UnProtectSheet()
Password = "test"
ActiveSheet.Unprotect Password
End Sub

Kind Regards

Tue 3 Mar 2009: Automatically marked as resolved.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Entering text in Multiple Worksheets

If you have a number of worksheets in a workbook that require the same information (data or tables) on each worksheet, this can be done as follows:

Hold down the Ctrl key and click one or more of the additional worksheet tabs (i.e. Sheet2, Sheet3, etc).

In your mainsheet (Sheet1) enter the required data or design a table.

When done 'Click' on the other sheet tabs and you will see that the information entered in Sheet1 is on all the other selected worksheets.

NB Do not forget to deselect the worksheets - otherwise you may add data to the main worksheet and all the selected worksheets will also have that data!

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.12 secs.