Code in a form and have it as a button or button in ribbon

drop05

Active Member
Joined
Mar 23, 2021
Messages
285
Office Version
  1. 365
Platform
  1. Windows
Hello, i created a Form in the VBA editor and have code inside it. I am trying to find a way to have a button on a page or in the ribbon so it can be clicked and pop up the form (GUI) so it can run the code inside it, but not sure how to do so, when creating a button it is only letting me assign subs that are in my moduels
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Hello, i created a Form in the VBA editor and have code inside it. I am trying to find a way to have a button on a page or in the ribbon so it can be clicked and pop up the form (GUI) so it can run the code inside it, but not sure how to do so, when creating a button it is only letting me assign subs that are in my moduels
You could create a sub that references the form?
 
Upvote 0
I suppose so, but how could i do that? The same as calling a sub? If i have the form called "frmImport"
If your form name was UserForm1, then your sub would be something like:

VBA Code:
    With UserForm1
        .Show
    End With
 
Upvote 0

Forum statistics

Threads
1,214,431
Messages
6,119,458
Members
448,899
Latest member
maplemeadows

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