Form start position

  • Thread starter Thread starter drewdog
  • Start date Start date
D

drewdog

I have a form called "switchboard" in an excel personal.xls file.

I have another file that has a button that calls the macro "OpenSB"
which essentially contains the code:

"Switchboard.show"

There are a couple of choices in the properties for the startu
position of this form, but I would like it in a different position (
little left of center actually).

I know the properties startupposition needs to be on manual, but othe
than that how do I control the form's position more?

1. What code
2. Where that code belongs (I get confused about where I should b
putting the code, I guess it should go in the personal.xls MainModule


And what about load or unload? Is that needed? If so why, and wher
should it go?

Thanks for any help you can offer.

Dre
 
You can experiment to see where you want the form positioned. The code goes
in the UserForm module:

Private Sub UserForm_Activate()
Top = 200
Left = 200
End Sub

Your Show command will automatically load the UserForm; there is no need for
a separate Load statement.

To unload the form, use:

Unload Me

if in the UserForm module, or:

Unload Switchboard

if in another module.
 
Vasant:

Wow! It actually works. Can't thank you enough man. This was bugging m
big time.

Dre
 
Back
Top