+ Reply to Thread
Results 1 to 7 of 7

Inventory using Excel

Hybrid View

  1. #1
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: Inventory using Excel

    It took a bit of experimentation but here is what worked for me. I assumed that the cell that got changed was in the range "C1:C20". I simply put a change event on the sheet. Cells changed by formula will not trigger an event. But cells written to by VB code can trigger an event.
    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Intersect(Target, Range("C1:C20")) Is Nothing Then Exit Sub
    
    MsgBox Target.Address
    
    End Sub
    Target is the cell that changed.

    I used the following code to trigger it.
    Sub test()
    Dim Scanned_Item As Variant
    Scanned_Item = InputBox("Scan the item")
    Range("C10") = Scanned_Item
    End Sub
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  2. #2
    Registered User
    Join Date
    05-17-2016
    Location
    Philadelphia, PA
    MS-Off Ver
    2013
    Posts
    4

    Re: Inventory using Excel

    Thanks for looking into this! One more questions:

    Is there a way to have the cursor move to the changed cell ONLY when a new code is scanned, and therefore adding it to the bottom of the list. Here is what the code looks like now for ADDING to the inventory:


    Private Sub Worksheet_Change(ByVal Target As Range)
    Select Case Target.Address
    Case "$A$4" 'add
    If Target.Value <> "" Then
    On Error Resume Next
    Set xitem = Range("C8", Range("C" & Rows.Count) _
    .End(xlUp)).Find(Range("A4").Value)
    With xitem.Offset(0, -1)
    .Value = .Value + 1
    End With
    On Error GoTo 0
    If xitem Is Nothing Then
    With Range("C" & Rows.Count).End(xlUp).Offset(1, 0)
    .Value = Target.Value
    .Offset(0, -1) = 1
    End With
    End If
    Range("A4") = ""
    Range("A4").Select
    End If


    Thanks Again!

+ 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] Need Help with Inventory Sheet: Adding to the inventory and Logging
    By petg in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-09-2015, 02:26 PM
  2. Want to set Week End Inventory #s to load in Opening Inventory
    By tkeat1692 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2013, 11:24 PM
  3. Barcode Inventory System - Running Inventory
    By b.dennis.79 in forum Excel General
    Replies: 2
    Last Post: 01-10-2013, 03:16 PM
  4. [SOLVED] Need remaining average inventory price after partial inventory is sold
    By Akano in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-04-2012, 04:12 AM
  5. Inventory Age Formula Needed for FIFO Inventory
    By SWeisser in forum Excel General
    Replies: 0
    Last Post: 07-20-2012, 02:44 PM
  6. FIFO Inventory- COGS & Inventory Valuation
    By aromaveda in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-24-2009, 02:05 AM
  7. Replies: 0
    Last Post: 10-04-2005, 08:05 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