How to create a custom Popup form in Excel

Asked By 230 points N/A Posted on -
qa-featured

Hi,

I am doing some work with Excel. I am not much familiar with VB but the Excel macro seems easy and interesting. I have yet used MsgBox and buttons to do almost everything. The Excel sheet was the main window which is used as a form for hosting the other stuffs.

For example if i need 3 data to input I use something like

x = InputBox("enter the value", "Its the title")

3 times.

Now I think it would be cool to have my custom popup messages/forms for doing all these. But how do I do this? Please help.

SHARE
Best Answer by Simmy C-me
Answered By 0 points N/A #97801

How to create a custom Popup form in Excel

qa-featured

You sure can do this:

  • First of all you are going to design the "custom form". Just go to design mode (where you code) and right click your project and insert a new userForm.
  • A blank form should appear. Use the tool box to enrich the form as you need. You can use them as you wish , also remember to give them a good name ( self explanatory names will aid you when coding the logic)
  • You used 3 input forms so here we can expect 3 text fields with labels. Also add a button.
Answered By 0 points N/A #97802

How to create a custom Popup form in Excel

qa-featured

That was a pretty clean solution by Simmy.

If the toolbox doesn’t show up go to view toolbox.  And yes no matter what you add in the form, give the form (itself) a good relevant name like "datainput". You have to use to show the form.

Answered By 230 points N/A #97804

How to create a custom Popup form in Excel

qa-featured

Thanks for the sharp reply.

I have made the form as you said. The name of the form is "datainputform". The three fields are

  • Name
  • ID
  • Payment

Now what?

Best Answer
Best Answer
Answered By 0 points N/A #97805

How to create a custom Popup form in Excel

qa-featured

Giving the text field name "Name" may conflict with other attribute. Name is also a attribute . So instead of "name" give it "NameField"

When done, double click the button in the form and do your calculation there. You can access the value in the 3 fields by:

  • NameField.Text
  • ID.Text
  • Payment.Text

Hope this helps.

Answered By 0 points N/A #97807

How to create a custom Popup form in Excel

qa-featured

Simmy is right. And yes, when you are done with the form, you have to add this:

datainputform.Show

Wherever you want this form to be shown.

Answered By 230 points N/A #97809

How to create a custom Popup form in Excel

qa-featured

Yeppy.  Thanks both of you.

Answered By 0 points N/A #97810

How to create a custom Popup form in Excel

qa-featured

You are welcome

Login/Register to Answer

Related Questions