+ Reply to Thread
Results 1 to 3 of 3

Help Setting Up Inventory Sheet to be used with a Barcode Scanner

Hybrid View

  1. #1
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Help Setting Up Inventory Sheet to be used with a Barcode Scanner

    There could be fancier ways, but since you have most of the code already, I just modified the last section a bit:

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    Dim Item As String
    Dim SearchRange As Range
    Dim rFound As Range
    Dim newDesc As String
    Dim newQty As Long
    
    'Don't run the macro if:
    'Target is not a single cell:
    If Target.Cells.Count > 1 Then Exit Sub
    'or Target belongs to the A1.CurrentRegion:
    If Not Intersect(Target, Range("A1").CurrentRegion) Is Nothing Then Exit Sub
    
    'Avoid the endless loop:
    Application.EnableEvents = False
    
    'Looks for matches from the here first:
    Set SearchRange = Range("A1:A" & Range("A1").CurrentRegion.Rows.Count)
        
    Item = Target.Value
    
    'Clears the Target:
    Target.Value = ""
    
    If Application.WorksheetFunction.CountIf(SearchRange, Item) > 0 Then
    'There's a match already:
        Set rFound = Columns(1).Find(What:=Item, After:=Cells(1, 1) _
                , LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows _
                , SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
    'Adds one to the Quantity:
            rFound.Offset(0, 2).Value = rFound.Offset(0, 2).Value - 1
    
    Else
    
    'Writes the value for the Barcode-list:
        newDesc = InputBox("Please enter the description for this new product")
        newQty = InputBox("What is the quantity for this item? (After removing the current one)")
        Range("A" & SearchRange.Rows.Count + 1).Value = Item
        Range("A" & SearchRange.Rows.Count + 1).Offset(0, 1).Value = newDesc
        Range("A" & SearchRange.Rows.Count + 1).Offset(0, 2).Value = newQty
    End If
    
    'Enable the Events again:
    Application.EnableEvents = True
    
    End Sub
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  2. #2
    Registered User
    Join Date
    12-04-2020
    Location
    Duirham, North Carolina
    MS-Off Ver
    2019
    Posts
    2

    Re: Help Setting Up Inventory Sheet to be used with a Barcode Scanner

    Thank you so much for the help. That definitely fixed my issue. I'm now trying to make it a bit more robust and was wondering if you could give insight into another issue that I want to address with the sheet. My next goal is to have certain categories of products (laptops, desktops, monitors, and printers) scan and update the product count (as it's already set to do), but also bring up a custom form that then outputs the information from the form to an Access database. For example when I scan the laptop SKU it allows me to update the count, but then also loads a form asking for the following:

    1. Laptop Serial Number
    2. Model
    3. Owner (person entering the info)
    4. The date
    5. Any Comments

    I should have no issue creating the form itself, but I have no idea if it's possible to push out the form results directly to access instead of having it make a sheet in excel and then just export it to Access. I also don't know if it's possible to have excel distinguish between SKUS that will need to load the form (I was originally thinking of adding in a simple yes/no box for the user to indicate if they need to use the form).

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Inventory Mangement - Barcode Scanner
    By NewYears1978 in forum Excel General
    Replies: 13
    Last Post: 09-30-2020, 12:57 AM
  2. Replies: 3
    Last Post: 02-13-2020, 02:15 PM
  3. setting up an inventory management system with barcode scanner
    By Driekant in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2019, 05:13 AM
  4. Replies: 4
    Last Post: 08-25-2017, 01:39 PM
  5. Replies: 0
    Last Post: 03-17-2017, 10:52 AM
  6. Can Excel be used with a barcode scanner to track inventory?
    By polluxtroy12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2013, 09:43 PM
  7. Using a barcode scanner and UPC master sheet for Inventory Control
    By jlucas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-21-2011, 04:03 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1