userform vba

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

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Userform in VBA

Userform in VBA

resolvedResolved · Medium Priority · Version 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:

Closing Multiple Workbooks quickly

When you have several workbooks open in Excel and want to just close them all at once:

1) Hold down the SHIFT key before selecting the File menu.

2) Once in File menu release SHIFT key and select Close All option.

3) All your files will close. If files require saving Excel will ask if you want to save the changes.

View all Excel hints and tips


Server loaded in 0.09 secs.