userform vba
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

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

Userform in VBA

resolvedResolved · Medium Priority · Version 2003

replyReply Fri 23 Jan 2009, 15:46Delegate N.b. said...

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

Userform in VBA

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

For upcoming training course dates see: Pricing & availability

replyReply Wed 11 Feb 2009, 14:41 Edited on Wed 11 Feb 2009, 14:42Trainer Carlos said...

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.

 

Please browse our web site to find out more about
advanced+excel+courses and other Microsoft training courses.

Excel tip:

Return to the active cell after scrolling

When I scroll a long way down the screen from a selected cell, I can return to that cell with the Ctrl+Back Space shortcut. The active cell now appears in roughly the middle of the screen.

Shift+Back Space does something similar. Scroll down from the active cell and Shift+Back Space returns me to it and puts the active cell at the top of the screen; scroll up from the active cell and Shift+Back Space returns me to it and puts the active cell at the bottom of the screen.

Note also, that while Ctrl+Back Space will return me back to a selected range, Shift+Back Space only ever returns me to the active cell, which is normally at the top left-hand corner of any selected range.

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard