Excel is a great option for those who seek ready-made sheets for data entry. Though it would be difficult for you to enter data manually in Microsoft Excel that’s why a couple of tricks are available so that your data entry task can become automated.
Today, you will get to know how to automate data entry in Excel so that you can get rid of manual work. Let’s see how you can do it:
As a regular Excel user, you would know Visual Basic is an awesome feature that helps in automating whatsoever task you need to automate. With automation tools, you can even create real-time user forms. A special data entry form is used to upgrade the process as well as you can pay attention to each entry without scrolling between columns or rows.
How to Automate Data Entry in Excel by Creating a User Form with VBA?
Below some easy-to-follow steps are given to make a data entry form. Let’s have a look:
- Open a new Excel workbook and save it with the desired name.
- Change the file type to Excel Macro-Enabled workbook.
- Now, add two more sheets with the following names:
Sheet1: Home
Sheet2: Student Database
- You can change the names according to your choice.
- Add a button to control the user form macro in Sheet1: Home.
- Open the Developer tab and choose the Button menu given in the Insert drop-down list. You can put this button on the sheet wherever you want.
- Rename the button once it is placed on the sheet.
- Right-click on the button and click on the New option to get a new macro.
- Now, put this code in the editor window:
Sub Button1_Click ()UserForm.Show End Sub:
Let’s move on to design the user form once you are done with the Home and Student Database sheets.
- Go back to the Developer tab and open the Visual Basic menu to access the Editor. Or else, you can even press the ALT + F11 keys from the keyboard to access the Editor window.
- Select the UserForm from the Insert tab menu.
- On the screen, you will notice an empty user form is there with a toolbox that contains every necessary tool that might be needed.
- Now, choose the Frame option given in the toolbox. You need to drag it to the user form and resize it.
- Rename the frame name and change the Caption column name to display the name on the sheet.
- Open the Label menu and add two labels in the frame. You may put the first one’s name as Application Number and the second as Student ID.
- To change the names, you need to use the Caption option given in the Properties section.
- Add two boxes right next to the label boxes to access the inputs of the user. Use the Properties section to change the names of these two boxes. Below you can see two names are given:
Textbox1: txtApplicationNo
Textbox2: txtStudentID
How to Automate Data Entry in Excel with Data Validation?
In this method, you will find a simple procedure that uses Data Validation to automate data entry in Excel. With this feature, you can simply control what data you have added to the cell. Data Validation features can also modify the restrictions of data entry for a user. Below we have a dataset to explain the procedure:
- Select cell B11:B15.
- Open the Name Manager box located next to the formula tab.
- Add Fruits in the Name Manager box.
- Now, choose cell range B11:B14 and enter the fruit price in the Name Manager field box.
- Choose the cell range B5:B8.
- Now, open the Data tab.
- Select the Data Validation drop-down menu from which you need to choose the Data Validation option.
- The Data Validation dialog box will pop up.
- From the dialog box, open the Settings menu. Click on the List option given in the Allow drop-down menu.
- Enter the name range value ‘=Fruits’.
- Press OK.
- A drop-down icon will appear in front of you and from this, you need to choose another data range.
- Choose the cell range C5:C8.
- Put the following formula in the bar:
=LOOKUP(B5,fruitprice):
- To apply the formula in the selected cells and for this press CTRL + Enter key.
- In cell B5, choose any fruit name you can see in the drop-down list. Ultimately, in cell C5, you will get the price of fruits by default.
That’s it!
Let’s Wrap Up:
In this post, you have learned how to automate data entry in Excel with the help of the Data Validation feature and VBA. Both procedures are helpful in automating the process of data entry. Try both approaches so that you can understand which method suits best to you.