A simple parcel tracker

Boboka

New Member
Joined
Jan 19, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Hi, I am looking for a simple parcel barcode tracker but I do not have any idea with VBA code. I hope someone here could help me.

I am planing to have a sheet 1(parcels) where I scan in barcode in column A2, with their date and time in B2. It will then move next to A3 column pending for next scan etc..

For the collection of parcel, in sheet 2(collection), scan the barcode of the person if he have it, or key in the barcode in a search box. If the scanned barcode is found in sheet 1, we will scan the person ID barcode who collected it. The found parcel barcode will be deleted from sheet 1(parcels) row, but appeared in sheet 3(collected) with the parcel barcode, date and time the parcel arrived, date and time the parcel collected and the ID of the person collected it. If no parcel is found, just show “no parcel entry”.

Thanks in advance if anyone can help.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
What I understand, you have something like this:
1673442207158.png

1673442223927.png


What you want is:
1673442256982.png


Am I correct?
 
Upvote 0
Yes, the sheet 1 (like a warehouse) you shown is whatever parcel came we just acknowledge and scan it into excel with date stamp.

The sheet2 you have shown is to find a particular parcel by barcode when the person come to me, if it is found it can be collected by the person. If it is not found then “parcel not found “.

The sheet3 is the data collected you shown, yes exactly this way. Whatever parcel barcode collected, it should not appeared in sheet1 anymore.

Thank you for your time.
 
Upvote 0
The sheet2 you have shown is to find a particular parcel by barcode when the person come to me, if it is found it can be collected by the person. If it is not found then “parcel not found “.
I have a question about this step:
Is there goning to be a searchbox to search for parcel barcode? Then if it is found, it will prompt Personel ID. You will input it also manually and this will be a new record in sheet2.

Something like this?

Right after the code will collect to data in sheet3, it will delete the parcel in sheet1.
 
Upvote 0
Yes, sheet 2 main purpose will be like a search box. We scanned/input the parcel Barcode in the box.

if parcel barcode is found in sheet 1( which is like a warehouse), it can be collected by the person. We scan/input the person id barcode.

This found parcel will be remove from sheet 1 after collecting. Parcel barcode, arrival date, parcel collected, person ID will appeared in sheet 3.

Thank you.
 
Upvote 0
First input a Personel ID to Sheet2 A2. Then input a Barcode to Sheet 2 B2:
I hope this would be a good start for you.
 
Upvote 0
Hi, thank you so much for your time.
But for sheet 1, I find that for every parcel code I entered or scanned, it never auto show the arrival date?

Is it my error?
 
Upvote 0
Oh sorry, I've totally missed that part. I thought the date information is coming from the scanner automatically. Find the sample:

In Sheet 1 macro, you may also have a validation check if barcode is in the correct format or not. Let's say each barcode must be 7 characters long. Then the code will be:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  If Not Intersect(Target, Range("A:A")) Is Nothing Then
    Application.EnableEvents = False
    If Len(Target.Value) = 7 Then
      Target.Offset(, 1).Value = CDate(Format(Now, "dd.mm.yyyy"))
    Else
      Target.Value = ""
      MsgBox "Invalid barcode!", vbCritical, "ERROR"
    End If
    Application.EnableEvents = True
  End If
End Sub
 
Upvote 0
Hi, thank you.

By using the new sample files, I do have a run time error.
run_time_error.png
debug.png


I do have any question is that for sheet 2, it act like a searchbox. So after scanning Person ID, and Parcel Code if ParcelCode is found, a msg box "Parcel Collected". Not sure whether I do it correct by adding the code above.
VBA Code:
 If exist Then
        MsgBox "Parcel Collected!", vbExclamation, "SUCCESS"
      End If
      
      If Not exist Then
        MsgBox "Barcode not found!", vbExclamation, "WARNING"
      End If

After each scan, the cursor will go back to A2 cell waiting for next scan instead of the cursor dropping to A3 cell.

Once again, thank you for your time.
 
Upvote 0

Forum statistics

Threads
1,214,867
Messages
6,122,002
Members
449,059
Latest member
mtsheetz

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top