How to Make Auto Enter with Barcode Scanner in Excel

Get FREE Advanced Excel Exercises with Solutions!

Microsoft Excel is a powerful software to conduct the same work as technological devices. With this, we can auto enter the barcode scanner without any scanning device. Whenever you scan any barcode through a scanner machine, it takes the number and scanning date with time for the record. Here, we will do the same in excel. Therefore, in this article, we will learn how to make an auto enter barcode scanner in excel with quick steps.

Download Practice Workbook

Get this sample file to practice by yourself.

What Is Barcode?

Barcode is a machine-readable code. It encodes information with spaces and varying widths of parallel lines. These spaces and lines represent numeric values and characters. Barcodes can encode product information, ID information of employees, any organizational information and lots more. It brings ease, speed, and accuracy to certain work of conduct.

Step by Step Procedures to Make Auto Enter with Barcode Scanner in Excel

This article will guide you with step-by-step procedures for making auto enter barcode scanners in excel. So without further delay, let’s hop into the steps below.

Step 1: Prepare Worksheet for Data Entry

To start the process, we need to prepare a worksheet first where we will insert all the data one by one. For this reason, here is a data table where the Barcode Numbers will be placed in cell range B5:B14 and the Date & Time values will be automatically entered in cell range C5:C14.

Step by Step Procedures to Make Auto Enter Barcode Scanner in Excel

Read More: How to Use Barcode Scanner in Excel (2 Suitable Ways)

Step 2: Setup Visual Basic Window

At this stage, we will set up the Visual Basic window to insert the VBA Macro code.

  • First, go to the Developer tab and select Visual Basic.

Step by Step Procedures to Make Auto Enter Barcode Scanner in Excel

  • Then, you will see the Visual Basic window appear.
  • Here, double-click on Sheet1 which has the dataset.

Note: Here we will directly input code to the specific sheet, this is why we selected the worksheet. Otherwise, if you type the code in Module from the Insert section, the code will run all over the workbook. It may hamper other worksheets.
  • Now, select Worksheet as the object sheet.

  • Along with it, select Change as the VBA event for this code.

Read More: Creating a Barcode Scanner Macro in Excel (with Easy Steps)

Similar Readings

Step 3: Insert VBA Macro Code

Now comes the important part of our tutorial.

  • First, insert this VBA Macro code on the blank page.
Private Sub Worksheet_Change(ByVal Target As Range)

Dim TableRange As Range
Dim DateTimeRange As Range

Set TableRange = Range("B5:B14")

If Intersect(Target, TableRange) Is Nothing Then Exit Sub

Set DateTimeRange = Range("C" & Target.Row)

If DateTimeRange.Value = "" Then
   DateTimeRange.Value = Now

End If

End Sub

Step by Step Procedures to Make Auto Enter Barcode Scanner in Excel

Here, Range (“B5:B14”) and Range (“C”) are changeable according to your dataset. For example, if your Barcode Numbers are in cell range A4:A10 and outputs are in column B then the code will be Range (“A4:A10”) and Range (“B”) respectively.
  • Then, click on the Save button and close the Visual Basic window.

Read More: How to Generate Barcode Numbers in Excel (with Easy Steps)

Step 4: Run Auto Enter for Barcode Scanner

Finally, we will auto enter barcode scanners.

  • First, insert your required barcode number in cell B5.

Step by Step Procedures to Make Auto Enter Barcode Scanner in Excel

  • Then, press Enter.
  • That’s it, you will see that the Date & Time is automatically placed in cell C5.

  • Following this process, insert each number to get the final output for different times.

Excel Barcode Scanner Auto Enter

Read More: Barcode Scanner Entry to Excel Database with Timestamp (3 Basic Cases)


In this article, we tried to demonstrate the process of how to make an auto enter barcode scanner in excel with quick steps. Let us know if you have any other methods for this. Keep an eye on ExcelDemy for more exciting articles on excel.

Related Articles

Sanjida Mehrun Guria
Sanjida Mehrun Guria

Hello! Welcome to my blog. I have completed my Bachelor in Architecture from Ashanullah University of Science & Technology, Dhaka. I am a passionate, goal-oriented person with an immense thirst for knowledge and an attitude to grow continuously. Besides Architectural work, I find it very enthusiastic to work in Excel blogging. Exceldemy is a platform where I have got the opportunity to flourish my skill in Microsoft Excel and therefore, here I will be posting blogs related to it.

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF