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:
- Press Alt-F11 to bring up Visual Basics menu
- Click the drop down menu in the upper left hand and select UserForm:
- Press F4 to bring up the properties menu. Use this box to change the userform’s name:
- Next, use the “Caption” field to change the UserForm’s caption:
Add a Button:
- Using the Toolbox Controls, add a Command Button:
- In the UserForm area, single click to create a standard size button, or click and drag to create the button size you want:
- Click on the button’s text to edit it’s display text:
- 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!
- Double-click on your Command Button (or whatever you’ve named it in the properties menu), to bring up the event script menu.
- 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”:
- [snippet id=”50″]
Check out the video below for more details!
[frontpage_news widget=”14410″ name=”You Might Also Like”]
You Might Also Like
We had a question today regarding how to increase or decrease the date field in this Excel VBA user form. The first thing we had to do was create a user form and insert a Text Box. When we double-click on this text box, the default event is the change...
If you need to Prompt to open a file in Excel VBA, check out the below code snippet. Please leave us a comment below if you have questions or comments and share this page if you think it can help others!...
Sometimes you might have a client or you yourself may have the need for a date text box where the user wants to type in only the numerals for a date, and none of the slashes. The first thing we need to do is create a user form with a single text box in it....
Sometimes using a text box on a user form or on a worksheet doesn't work exactly the way we think it should. This is especially true when were working with dates and times straight from a worksheet. The problem we faced when helping Emil was that the format function...
Sometimes using loops with the fileSystemObject in Visual Basic isn't the most intuitive thing to use, but in this article I want to show you some basic things you can do with it. Without getting too technical, the purpose of this article is to show you how you can...
Recently, I was asked how to format Textboxes as Hours and Minutes, like a Start Time and End Time, here's a quick video tip I replied with. Hope you enjoy! https://www.youtube.com/watch?v=HaPAPweKsOM Get the workbook here...