I have problem with my userform to open with button

TLS49

Board Regular
Joined
Nov 26, 2019
Messages
132
Office Version
  1. 365
Platform
  1. Windows
I have problem with my userform to open the form up with button. It not open form by click a button. I put name of userform.show. give me a error runtime error 438.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
The problem is in the code of your userform.

Put all your code here for review or share your file to see what the problem is.


You could upload a copy of your file to a free site such www.dropbox.com or google drive. Once you do that, mark it for 'Sharing' and you will be given a link to the file that you can post here. If the workbook contains confidential information, you could replace it with generic data.
--------------
I hope to hear from you soon.
Respectfully
Dante Amor
--------------​
 
Upvote 0
What happens is that your button and your userform have the same name, so when you use this method:

NFL_SCORES_FORM.Show

What you're trying to do is execute the method Show on the commandbutton and that method doesn't exist.

1687829317420.png


Just change the button name to something like this:

1687829759827.png


Change the code to this:

VBA Code:
Private Sub NFL_Button_Click()
  NFL_SCORES_FORM.Show
End Sub

:cool:
 
Upvote 0

Forum statistics

Threads
1,215,284
Messages
6,124,064
Members
449,139
Latest member
sramesh1024

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