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

protecting created user forms

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Protecting created user forms

Protecting created user forms

ResolvedVersion 2003

Gary has attended:
Access VBA course
Excel VBA Advanced course

Protecting created user forms

When you lock/unlock cells and then use protect so the users do not change the functions or delete anything by mistake. Is there anything you can do in a user form so they can hide the unprotect function?

RE: Protecting created user forms

Hi Gary, thanks for your query. You could add the following line of code to a user form - or, indeed, the Auto_Open subroutine - to delete the "Unprotect Worksheet" option from the drop down toolbar:

Application.CommandBars("Protection").Controls(1).Delete

Be careful how you deploy this and try to add the Protect Worksheet function back automatically when the spreadsheet closes.

Hope this helps,

Anthony

RE: Protecting created user forms

Anthony,

Thanks very much!

I will try this line out.

Thanks,

Gary

 

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:

Activating the formula bar with the keyboard in Excel 2010

The formula bar in Excel 2010 contains a number of different formulas. However, it is time consuming to open the formula bar every time and insert the formula using the mouse. Instead, you can activate the formula bar with the keyboard. Simply press the F2 button on the keyboard then the information in the cell will expand allowing you to edit the information in the cell.

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.1 secs.