UserForm Basics #1

Here, you’ll learn to make a UserForm, add a button, and make clicking on that button hide the UserForm!

Make a UserForm:

  1. Press Alt-F11 to bring up Visual Basics menu
  2. Click the drop down menu in the upper left hand and select UserForm:Screen Shot 02-10-16 at 11.46 PM
  3. Press F4 to bring up the properties menu. Use this box to change the userform’s name:Screen Shot 02-10-16 at 11.56 PM
  4. Next, use the “Caption” field to change the UserForm’s caption:Screen Shot 02-11-16 at 12.02 AM

 

Add a Button:

  1. Using the Toolbox Controls, add a Command Button:Screen Shot 02-11-16 at 12.05 AM
  2. In the UserForm area, single click to create a standard size button, or click and drag to create the button size you want:Screen Shot 02-11-16 at 12.15 AM
  3. Click on the button’s text to edit it’s display text:Screen Shot 02-11-16 at 12.16 AM
  4. Using the properties menu on the left, you can change the button’s color, font, and other properties!

Hiding the UserForm when the button’s pressed!

  1. Double-click on your Command Button (or whatever you’ve named it in the properties menu), to bring up the event script menu.
  2. Use the command “.Hide” as shown in the picture below. In this example, the UserForm’s name was HideForm, thus the script line is “HideForm.Hide”:
  3. [snippet id=”50″]

Check out the video below for more details!

 

 

[frontpage_news widget=”14410″ name=”You Might Also Like”]

 

You Might Also Like

Excel VBA UserForms #2

Excel VBA UserForms #2 Create a UserForm with 2 option buttons:  1 Sort by Employee ID or 2 Sort by Name. Part one, create the UserForm and give it buttons. First, bring up the VBA UserForm editor (F11), and add a new UserForm  using the...

Getting the Last Row with Excel VBA

Getting the Last Row with Excel VBA

One of the most important things you'll learn in Excel VBA is grabbing the last row in your code. Here's how to do it. Let's say we need the bottom used cell in column A (column 1), we can copy/paste this code for the row number: [cc lang="vbscript" lines="-1"...

X

Forgot Password?

Join Us

Discover the Secrets of Excel Your Coworkers Don't Want You To Know and Your Boss Will Love You For...

Thanks... Video will load in just a sec...

Discover the Secrets of Excel Your Coworkers Don't Want You To Know and Your Boss Will Love You For...

Thanks... Video will load in just a sec...

0
    0
    Your Cart
    Your cart is emptyReturn to Shop