• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Command Button to Bring Up Data Entry Form

RTowles

Member
I'm trying to create a simple form for people to use. If you push the button the form will pop up and you can enter the information.

My VBA Code is
Private Sub CommandButton1_Click()
Range("B10").Select
Medline2017AGB.Show
End Sub

But once you push the Command Button1 I get the error: Run-Time Error 404: Object Required

If you click on A1 and the data entry form on the ribbon it'll populate the data entry form i want.

What am i doing wrong?
 

Attachments

  • Button Work.xlsm
    21 KB · Views: 5
You don't have any userform in the workbook. Without it, "Medline2017AGB.Show" won't do anything.

In VBE, right click on Project pane, and add Userform and name it "Medline2017AGB".
 
To make it easier I just changed the name of the form to UserForm1, but an error doesn't come up any more (YaY!) but now NOTHING comes up!

Please help.
 

Attachments

  • Button Work.xlsm
    23.6 KB · Views: 3
Well, you didn't assign the code to button.

Go to developer tab, click on Design Mode and right click on the button then View Code.

Your code should go in there. Also, there's no need for Range("A1").Select
 

Attachments

  • Button Work (1).xlsm
    24.3 KB · Views: 10
Back
Top