Results 1 to 4 of 4

Scan, timestamp, and keep count

Threaded View

  1. #1
    Registered User
    Join Date
    01-20-2021
    Location
    Minnesota, USA
    MS-Off Ver
    office 365
    Posts
    7

    Scan, timestamp, and keep count

    Good day, I would like some help getting this code to also keep count of reoccurring information. Right now I have a scanner I use to scan a barcode, then it will enter the number the first column. It will then enter a timestamp in the second column. I am trying to get it to keep keep a count of how many times the same barcode is scanned.

    I am very green to coding let alone coding in excel.

    I found this code online and it has another part that if the same barcode is scanned to add a timestamp to the right of the first time is was scanned. It was meant to be used as a time in and time out sort of thing.

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Me.Range("B2")) Is Nothing Then
            Application.EnableEvents = False
            Call inout
            Application.EnableEvents = True
            
        End If
    
    End Sub
    
    Sub inout()
    Dim barcode As String
    Dim rng As Range
    Dim rownumber As Long
    
    barcode = Worksheets("Sheet1").Cells(2, 2)
    
        Set rng = Sheet1.Columns("a:a").Find(What:=barcode, _
        LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _
        SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
        If rng Is Nothing Then
            ActiveSheet.Columns("a:a").Find("").Select
            ActiveCell.Value = barcode
            ActiveCell.Offset(0, 1).Select
            ActiveCell.Value = Date & "  " & Time
            ActiveCell.NumberFormat = "m/d/yyyy h:mm AM/PM"
            Worksheets("Sheet1").Cells(2, 2) = ""
        Else
            rownumber = rng.Row
            Worksheets("Sheet1").Cells(rownumber, 1).Select
            ActiveCell.Offset(0, 2).Select
            ActiveSheet.Range(Cells(rownumber, 6), Cells(rownumber, 17)).Find("").Select
            Worksheets("Sheet1").Cells(2, 2) = ""
                
        End If
    Worksheets("Sheet1").Cells(2, 2).Select
    
        
    End Sub

    I asked the owner of this code for assistance in editing it to what I am asking but was just given this code, but not told where to put it.

    ActiveSheet.Range(Cells(rownumber, 6), Cells(rownumber, 17)).Find("").Select
    Is it even possible to have excel keep track of counts for matching barcodes?
    Last edited by ab0d0n; 01-20-2021 at 05:00 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Scan subfolders for PDF files and count pages
    By ISMI in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 10-04-2018, 10:13 AM
  2. [SOLVED] Count only the highest timestamp value of each set of values
    By razz0807 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-01-2016, 01:48 PM
  3. [SOLVED] Scan and Count Rows
    By trevor2524 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-31-2016, 12:01 AM
  4. RFID Time and date stamp on scan and off scan
    By forey89 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-14-2015, 06:46 AM
  5. Scan-in, Scan-out tool inventory with barcode scanner
    By rycr023 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-20-2014, 11:52 AM
  6. scan through sheets to count cells with specific content
    By ossa in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-06-2012, 12:08 PM
  7. How to get a count of timestamp on 1 date
    By macking in forum Excel General
    Replies: 4
    Last Post: 04-13-2011, 12:55 PM

Tags for this Thread

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