call a userform from a button

hitch_hiker

Active Member
Joined
Feb 21, 2012
Messages
294
I have created a userform called "frmProductList", how can I make this userform show when I press a button, does the button need to be a form or activeX control? subsequently once the userform has done it's job how do I close the userform, ( I'm guessing unload.me )
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Either should work,

Use a Form Button to test it out.

In a module sheet in VBA add in a sub routine like this

Sub ShowFormName()
UserForm.Show
End Sub

Then go back to your worksheet and right click your button and select Assign Macro and use the macro name as above.

Behind your form perhaps on a Command Button for Closing it would be something like this, depending on the name

cmdClose()
Unload Me
End Sub
 
Upvote 0
thanks for that, it's probably very easy once you know how, would be better if excel help actually helped.
 
Upvote 0
Help does work but sadly you need to know how to use it to the best advantage, aslo you can use the object browser, you would Press F2 it should give you the syntax you need.

However pleased to read you have a solution and thanks for letting me know.
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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
Back
Top