Help

  • Thread starter Thread starter Peter Baranya
  • Start date Start date
P

Peter Baranya

Hi
I'd really need some help with Exel. I've written a
Userform using the Visual Basic program of Exel. My
Problem is that I can't seem to display it in my
Workbook. It's a menu that allows the user to select
languages to wiew the sheet with the use of buttons. I'd
like it to come up whenever anyone opens the workbook, or
display this box in one of the sheets. I'd really
appreciate any help.


Thanks a lot
Newt
 
Peter,

You need a macro to show the userform. It could be called from the auto-open macro or the workbook's open event.

Sub ShowUserform()
Load Userform1
Userform1.Show
End Sub

Change 'Userform1' to the name of your userform.

HTH,
Bernie
Excel MVP
 
Hi

I've gotten it o open but only if I open the macro from
the macro open menu. How can I get it to open
automaticaly (where can I find the auto-open macro or the
workbook's open event)? Sorry for troubling you but I'm
really desperate, I have to get this done in a couple of
hours, and I've spent 90% time trying to get the program
to open automaticaly, or to open at all (the whole point
of it is so employees won't have to use macros).
Thanks
-----Original Message-----
Peter,

You need a macro to show the userform. It could be called
from the auto-open macro or the workbook's open event.
Sub ShowUserform()
Load Userform1
Userform1.Show
End Sub

Change 'Userform1' to the name of your userform.

HTH,
Bernie
Excel MVP


"Peter Baranya" <[email protected]> wrote in
message news:[email protected]...
 
Peter,

Go to your VB Editor (use Alt-F11). In the Project Explorer (use View | Project Explorer OR Ctrl-R to make sure it is showing),
select the ThisWorkbook object by double clicking it. In the code window that appears, select "Workbook" from the upper left
dropdown selection box, then "Open" from the upper right dropdown box. This code:

Private Sub Workbook_Open()

End Sub

will appear in the codemodule. Simply add your two lines in the middle to get:

Private Sub Workbook_Open()
Load Userform1
Userform1.Show
End Sub

Then anytime the workbook is opened, the userform will appear.

HTH,
Bernie
Excel MVP
 
Back
Top