creating a user form in excel

Copper Contributor

I want to create a form in excel that takes information about tools.  After entering the data I want to click on an add button to insert the new item into the list.

1 Reply


To create a user form in Excel for entering information about tools and adding new items to a list, you can use Excel's built-in Form Controls and VBA. Here's a step-by-step guide:

1. Set up your Excel worksheet:

    • Create a table where you want to store the tool information. Include columns for each piece of information you want to collect (e.g., Tool Name, Description, Quantity, etc.).
    • Optionally, you can format the table as a named range to make it easier to reference in VBA.

2 . Insert Form Controls:

    • Go to the Developer tab on the Excel ribbon. If you don't see the Developer tab, you may need to enable it in Excel's options.
    • Click on "Insert" in the Controls group, then choose the desired form controls for each piece of information (e.g., text box, combo box, etc.). These form controls will be used to input data about the tools.

3. Design the User Form:

    • Arrange the form controls on your worksheet to create the layout of your user form. Label each control appropriately to indicate what information it should capture (e.g., Tool Name, Description, Quantity, etc.).

4. Add Code to Handle Adding New Items:

    • Right-click on any of the form controls and select "Assign Macro" from the context menu.
    • In the Assign Macro dialog box, click "New" to create a new macro in VBA.
    • Write VBA code to collect the data entered into the form controls and add a new row to your table with this data. Here's an example of what this code might look like:

Vba code is untested, please backup your file in advance.

Sub AddNewItem()
    Dim ws As Worksheet
    Dim tbl As ListObject
    Dim newRow As ListRow
    ' Set a reference to the worksheet and table
    Set ws = ThisWorkbook.Worksheets("YourWorksheetName")
    Set tbl = ws.ListObjects("YourTableName")
    ' Add a new row to the table
    Set newRow = tbl.ListRows.Add
    ' Assign values to the cells in the new row
    newRow.Range(1) = ws.Shapes("TextBox1").Text   ' Adjust "TextBox1" to match the name of your text box control
    newRow.Range(2) = ws.Shapes("TextBox2").Text   ' Adjust "TextBox2" to match the name of your text box control
    ' Continue this pattern for other columns
    ' Optionally, clear the form controls after adding the new item
    ws.Shapes("TextBox1").Text = ""
    ws.Shapes("TextBox2").Text = ""
    ' Clear other form controls as needed
End Sub

5. Assign the Macro to the Add Button:

    • After writing the VBA code, assign the macro AddNewItem to the button or form control you want to use to add new items.

6. Test the Form:

    • Save your workbook and test the form by entering information about tools and clicking the add button to add new items to the list.

By following these steps, you can create a user form in Excel for entering information about tools and adding new items to a list with the click of a button. Adjust the form controls, layout, and VBA code as needed to fit your specific requirements. The text was created with the help of AI.


Please note that the availability of certain features and the user interface layout may vary slightly between different versions of Excel. Additionally, Excel Online (Excel for the web) may have limitations compared to the desktop version of Excel, particularly regarding VBA macros and form controls. Therefore, some features may not be available or may function differently in Excel Online.


If this suggestion is not what you search & want, please include detailed information in your message. In this link you will find instructions/help on which information you should best include in your request.

Welcome to your Excel discussion space!


My answers are voluntary and without guarantee!


Hope this will help you.


Was the answer useful? Mark as best response and like it!

This will help all forum participants.