Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA Userforms

Status
Not open for further replies.

autumn10

Technical User
Feb 21, 2011
9
US
How do I create a userform window (not dialogue box) with maximize, restore, & close buttons in the title bar? I want to do this under program control.
 

Do you want to do it in Word? Excel? Power Point? And what version of whatever you use.

In most cases, you may start by Alt-F11 (VBA editor), right-click on either VBAProject ot Sheet2 or whatever - (at least in Excel 2003) and choose Insert - UserForm

Have fun.

---- Andy
 
An important thing to know (I also just found out) If you select a control that you've added to the user form, and hit F7, it switches to code view and starts a subroutine for interacting with that control. This includes the form itself, resulting in a
[tt]
Private Sub Userform_click()
>
End sub
[/tt]

Just be sure to delete out any event routines you're not using.
 

You accomplish the same just by double-clicking the control on your Form.

Have fun.

---- Andy
 
Thanks for your responses but this isn't doing it for me. I'm trying to create a pure window in code with the intention of adding controls later, also in code. The underlying application is Excel.

See "UserForm Window" in the VBA help files. There, it says "Each form window has a Maximize, Minimize, and Close button". But inserting a userform only provides the Close button. How do I get the others? Do propertie xlMaximize, xlMinimize, etc. come into play?

Later, I may wish to remove the Title bar altogether. Can I do this?

 

Well, Microsoft does say in their Help: "Each form window has a Maximize, Minimize, and Close button.", but even the picture of the Form they have in Help does NOT have any of these buttons.

In 'classic' VB (VB 6.0) Form has BorderStyle property which allows you to select out of 6 different styles, but VBA has only 2 and none of them are what you want.

Have fun.

---- Andy
 
Andy -
You've confirmed the suspicion I've had all along.

I am able to do what I want but I have to use software that few people know about. It's called APL.

For now I will be looking to get VB.

Thanks for your reply.
-Mark

 

If so, forget about the 'classic' VB 6.0 I had mentioned. Go with VB.NET - you can get a free copy from Microsoft's site.

Have fun.

---- Andy
 
Thanks Andy -
Visual Studio 10 is kind of expensive.
I appreciate your suggestion.
-Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top