Creating Excel User Form – Using VBA Code!
Step One: Design User Form using excel visual basic, under developer tab.
Step Two: Create two labels and label them : “Name” & “Phone” Respectively
Step Three: Create “Submit” command button
Step Four: Write the below code between “Pravate Sub” of the command button and “End Sub” of the command button.
Refer to the image below and the code!

1 2 3 4 5 6 7 8 9 10 |
Dim sheet As Worksheet Set sheet = ThisWorkbook.Sheets("Sheet1") 'find new row to get the update nr = sheet.Cells(Rows.Count, 1).End(xlUp).Row + 1 'Update values in cells for record sheet.Cells(nr, 1) = Me.TextBox1 sheet.Cells(nr, 2) = Me.TextBox2 |
To Clear Text Boxes Use the Below Code
1 2 3 |
'clear text boxes for new values TextBox1.Value = "" TextBox2.Value = "" |