Barcode scanner

Krister

New Member
Joined
Nov 23, 2020
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Hello. i got a question about barcode scanner.. when i scan a number with the barcode scanner my macro`s arent working..? but the formula`s are working.. i cannot link the sheet i`m working on since its a invalid file.. but i will link the macro i am using, and link a picture of what`s not happening.. The red colour is when i scan with the barcode scanner.. the others is when i manually write the numbers.. the job of the marco is to post the date today (B), and copy the number from F to G


VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
    'disable events to stop changes made by this macro re-trigering it
    Application.EnableEvents = False
    'test if changed cell is a number
    If IsNumeric(Target.Value) Then
    Target.Offset(, 6).Value = Target.Offset(, 5).Value
        'only add a date if no date in column I
        If Not IsDate(Range("B" & Target.Row).Value) Then
            Range("b" & Target.Row).Value = Format(Date, "YYYYDDMM")
        End If
    End If
    're-enable events
    Application.EnableEvents = True
End If
Exit Sub

'error handler
ErrHnd:
Err.Clear
're-enable events
Application.EnableEvents = True
End Sub
 

Attachments

  • excel.png
    excel.png
    64.2 KB · Views: 84
Last edited by a moderator:
Well, the problem can be in saving that workbook at Application.Calculation = xlCalculationManual.
Turn manually the calculation to automatic via File - Options - Formulas - Workbook calculation - Automatic
Then save that workbook and try the code.
Or add that code to standard module of that workbook, save and reload it:
VBA Code:
Sub Auto_Open()
  ' This code runs automatically at this workbook loading
  Application.Calculation = xlCalculationAutomatic
End Sub
You may also just run that sub mannually without reloading.
That has been in automatic all the time. so the problem isnt there :/
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Please answer the question asked by ZVI in post #18
Does scanner change an active cell at all?

'YES it does' or 'NO it doesn't' ?
 
Upvote 0
There are only 2 possible answers to this question
one is YES it does, and the other is NO it doesn't.

I don't want to know about the formulae and the macro.

I want to know if, when you scan a number into a cell, does that cell remain the active cell ?
Or does the active cell become the next cell just like it does when you hit the enter key after entering a number manually ?
 
Upvote 0
There are only 2 possible answers to this question
one is YES it does, and the other is NO it doesn't.

I don't want to know about the formulae and the macro.

I want to know if, when you scan a number into a cell, does that cell remain the active cell ?
Or does the active cell become the next cell just like it does when you hit the enter key after entering a number manual

Just like it does when i hit the enter key after entering a number manual. it changes to the cell below
 
Upvote 0
That leads me to suspect that Events are somehow disabled.

Scanner or no scanner the move to the next cell should at the very least trigger Worksheet_SelectionChange.
Add that event with nothing but a message box and see if it triggers.

Can you share your workbook (no personal info) for examination?
 
Upvote 0
That leads me to suspect that Events are somehow disabled.

Scanner or no scanner the move to the next cell should at the very least trigger Worksheet_SelectionChange.
Add that event with nothing but a message box and see if it triggers.

Can you share your workbook (no personal info) for examination?
i see now that a "Handheld barcode scanner" is working on the sheet.. the one i was testing with is "Scan it to office" app on excel and phone.. and that one is still not working. i could send you the whole excel file by link in a message. i can just upload in on Catbox or something.. if that is okay with you?
 
Upvote 0
i just got a another question while i got a tread going here if that is okay ifc. but is there any place i can send all of my work, and get a price for what a company would take to make this? since i have alreaddy made a fully functional storage program in excel, and now this production overview. if someone know anything about that? :)
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,195
Members
453,021
Latest member
pingpong7117

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