Create An Excel UserForm
Create An Excel UserForm
1. Set up the the worksheet 2. Create an Excel UserForm 3. Name the Excel UserForm 4. Add a Textbox to the Excel UserForm 5. Add a Label to theExcel UserForm 6. Add remaining textboxes and labels 7. Add buttons to the Excel UserForm 8. Add code to the buttons 9. Test the Excel UserForm 10. Create a button to open the Excel
UserForm
(video is in 3 parts).
4. Click OK
1. Right-click on an empty part of the UserForm 2. Choose View | Code 3. Scroll to the bottom of the existing code, and enter the following code: Private Sub UserForm_QueryClose(Cancel As Integer, _ CloseMode As Integer) If CloseMode = vbFormControlMenu Then Cancel = True MsgBox "Please use the button!" End If End Sub 4. On the Menu bar, choose View | Object, to return to the UserForm.
1. Switch to Excel, and activate the PartLocDB.xls workbook 2. Select the PartsData sheet.
3. From the menu bar, choose Format | Sheet | Hide 4. Delete all other sheets, except Parts Data Entry
5. Click the Click here to add Part Information button, and enter your data into the
database. 6. Close and save the workbook Download the sample Excel UserForm file Download the sample file with an enhanced Excel UserForm, with comboboxes
See also, Excel UserForm video (video is in 3 parts) and Excel UserForm with Combo Boxes.