userform

bibstar03

New Member
Joined
Jan 30, 2003
Messages
25
I have created a userform using vb, but how can i view it over my worksheet? at the moment i can only view the form by going into vb

thanks
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

soberguy

New Member
Joined
Nov 28, 2005
Messages
13
The way I did this was by adding an auto shape, like drawing a circle or oval. Right click on that object, and select "assign macro." Click on "New" and your code for this "button" will be
Code:
Sub AutoShape1_Click()
    UserForm.Show
End Sub
NOTE: UserForm will be the name of whatever your userform is named. For example, my user form is used to add names to a list, so I call it AddForm. Thus, my code is:
Code:
Sub AutoShape1_Click()
    AddForm.Show
End Sub

Hope that helps
 

Joe Was

MrExcel MVP
Joined
Feb 19, 2002
Messages
7,539
Each UserForm you create is given an index number this number is amended to the generic form name: UserForm

So your 1st UserForm's name will be: UserForm1
and your 2nd one will be: UserForm2

To open your form for display you need to call the correct form from another Sub. To do this you can use any Module. Typically, if you want to Show your form on any Sheet in your Workbook you would place your Show Sub in a Standard module, like: Module1.

If you will only be showing your form on a certain Sheet, then you will store the Show Sub code in a Sheet Module, like: Sheet1.


The general Sub to do this is:

Sub myForm()

UserForm1.Show
End Sub


P.S: Technically "VB" is the language of Visual Basic, Microsoft Office products use a sub-set of VB known as VBA "Visual Basic for Applications." This sub-set contains things that only apply to office products, so they are not needed in the general VB language.

So if you can only view your form in "vb" you really mean: I can only view my UserForm in the VBA Editor or "VBE" for short!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,118
Messages
5,835,492
Members
430,359
Latest member
ManuelCukRia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top