Inventory Management using Barcode Scanner

mdugan2

New Member
Joined
Apr 7, 2015
Messages
2
Hello,

I am looking for some code that would allow me to use a bar-code scanner to create a simple inventory. I work in an office with a high degree of check-in/check-out activity for inventory, and being able to simply scan items in/out would be a big help.

Consolidating that data has been more of a challenge than I anticipated. My initial idea is that the sheet would look like this:

Item NameUserDispatcherCheck OutCheck InNotes
HOTSPOT1
4/7/2015 16:18

<tbody>
</tbody>
TABLET1
4/7/2015 16:18

<tbody>
</tbody>
4/7/2015 16:25

<tbody>
</tbody>
Battery reported low
TABLET1
4/7/2015 16:27

<tbody>
</tbody>
New battery swapped

<tbody>
</tbody>

The "User", "Dispatcher", and "Notes" column would be entered manually. Ideally, the "Item Name" and the out/in times would come from the bar-code scan. I have already created Code39 bar-codes with the Item names.

I have been using the following thread for guidance, but was having one big issue with it's format. Rather than have the Check In / Check Out time continually log in the same row, I would prefer to have the scan enter a new row after it has already been returned. I hope I've demonstrated this above. Here is the thread I am referencing. There is, of course, a large degree of flexibility in the format of this sheet. As long as all of the information is able to be entered and the format is readable, I'm all ears!

As I have very limited coding skills, any insight would be appreciated. Thank you so much for your help!
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
A few more relevant pieces of information.

Platform: Excel 2010

The below code is what I have been working with currently h/t to hiker95:

Code:
[COLOR=#333333]Option Explicit[/COLOR]Private Sub Worksheet_Change(ByVal Target As Range)
' hiker95, 12/30/2012
' http://www.mrexcel.com/forum/excel-questions/672492-scan-barcode-excel-date-time-stamp-out.html
If Intersect(Target, Range("A2:A3000")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target = "" Then Exit Sub
Dim lc As Long, fr As Long, n As Long, nr As Long
With Application
  .EnableEvents = False
  .ScreenUpdating = False
  n = Application.CountIf(Columns(1), Cells(Target.Row, 1))
  If n = 1 Then
    lc = Cells(Target.Row, Columns.Count).End(xlToLeft).Column
    If lc = 1 Then
      Cells(Target.Row, lc + 2) = Format(Now, "m/d/yyyy h:mm")
    ElseIf lc > 2 Then
      Cells(Target.Row, lc + 1) = Format(Now, "m/d/yyyy h:mm")
    End If
  Else
    fr = 0
    On Error Resume Next
    fr = Application.Match(Cells(Target.Row, 1), Columns(1), 0)
    On Error GoTo 0
    If fr > 0 Then
      lc = Cells(fr, Columns.Count).End(xlToLeft).Column
      Cells(fr, lc + 1) = Format(Now, "m/d/yyyy h:mm")
      Target.ClearContents
    End If
  End If
  On Error Resume Next
  Me.Range("A1", Range("A" & Rows.Count).End(xlUp)).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
  On Error GoTo 0
  nr = Me.Range("A" & Rows.Count).End(xlUp).Offset(1).Row
  Me.Cells(nr, 1).Select
  .EnableEvents = True
  .ScreenUpdating = True
End With [COLOR=#333333]End Sub[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,696
Members
449,048
Latest member
81jamesacct

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