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

userform vba

ResolvedVersion 2003

N.b. has attended:
Excel VBA Intro Intermediate course

Userform in VBA

How do you turn off the close button on a UserForm?

Edited on Wed 11 Feb 2009, 14:42

RE: Userform in VBA

Hi N.b.

If you place the following code in the form's QueryClose event it will prevent the close button being used to close the form

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)

If CloseMode = vbFormControlMenu Then

Cancel = True

End If

End Sub


Hope this helps

Caros

Wed 18 Feb 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:

Use Paint Brush to Format More than one Cell

To copy a format to many cells or ranges

1. Select the cell with the format that you want to copy

2. Double-click on the paint brush

When you move to the cell where you want to paste the format you will notice that a paint brush follows the cursor.

Paste the format to all the cells or ranges you need to format.

When finished go back to the paint brush on the tool bar and single click on it to deactivate the function.

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