Be the first user to complete this post
|Add to List|
VBA-Excel: User Forms
User Forms are one of the very important features in Excel Macro. It provides and an interface to the user for interaction with the workbook. It has many controls which makes user’s life easy for entering the data from excel in a specific manner or reading the particular data from the excel.
Getting Started : Create a Blank User Form
- To open or create a new user form, follow the steps below
- Open an Excel file
- Press “Alt+F11” to open the Microsoft Visual Basic Editor.
- Make Project Explorer and Property Window visible from “view menu” (If not already visible)
- Select the Project from the Project Explorer.
- Form “Insert” menu, select “User Form”
- Select the Userform1
- Go to the Property Window,
- Change the Name Property to “FirstForm”
- Change the Caption Property to “My First User Form”
16. Add Controls to the User form
- Select the control from the Tool Box and place it in the User Form.( here Command Button is selected)
- Select or Single Click on the Command Button from the Tool Box.
- Now Click on the UserForm, a new CommandButton will be created.
Private Sub FirstButton_Click()
MsgBox "Yeaaaahhhhh , I got Clicked"
NOTE : To Navigate Between “Code Window” and “UserForm Design Window” KeyBorad Shortcut is [Control]+[Tab]
17. Now your User Form is ready to run. All you have to do is assign this User Form to a macro.
Macro to Open the UserForm
- Select the VBA Project from Project Explorer
- Form “Insert” menu, select “Module”
- VBA Excel – Refer to Multiple Ranges : Union Method
- VBA-Excel: Copy/Paste data - Copy the Entire row data and paste it to another row
- VBA-Excel: Copy/Paste data - Copy the Entire data from one sheet to another
- VBA-Excel: Consolidator – Merge or Combine Multiple Excel Files Into One
- VBA Excel - Cells, Ranges and Offset: Refer Range by using A1 Notations
- VBA-Excel: Convert Numbers (Rupees) into Words OR Text - Updated Till 1000000 Crore With Decimal Numbers
- Excel-VBA : Prevent Adding New Worksheet
- VBA Excel - Cells, Ranges and Offset : Offset