barcode scan only

Oldbill62

New Member
Joined
Nov 26, 2014
Messages
23
Good morning everyone,
As with several other posts on here I am a relative novice on codes and such like so please keep n replies really really simple! I wish to set a particular cell on spreadsheet (Windows 7) to accept only scanned from barcode data. Is it possible to protect cell to ensure keyboard input cannot be used please?
Thanks
Oldbill
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Its scanned in from various worksheets. The aim of the project is to remove the necessity to print off documents, sign them and then pay for them to be archived for next 5 years. We are currently printing a rainforest every day and if I could use the barcode scanners to input a employee id this would be acceptable for traceability
 
Upvote 0
I'm not sure that it is without having a barcode reader to hand to test it. I *think* that barcode readers work like keyboards so I'm not entirely sure that Excel would be able to tell the difference
 
Upvote 0
As long as the barcodes are more that a 3 or 4 digits long. This can be done with a small chunk of code with a timer event
No need for a barcode scanner to test to make this work. It is based on the fact that a barcode scanner can 'key' faster than a human.
An 11 digit barcode is scanned in less than 1 second (I think 'blink of an eye' is the technical term).
The same 11 digits by a human would be about 2-3 seconds if an Olympic sport.
so the sudo code for an on key event.
wait for a key entry.
start a timer.
wait for Enter key then stop timer.
look at elapsed time from first key to Enter key.
(barcode scanners can be set to send an Enter key after reading barcode)
If less than 1 second it must have come from a barcode scanner. otherwise assume it was keyed by a human.

Of course as soon as you said only scanner entry and no manual entry.
The spreadsheet Gods and Code Gods are poised to strike you down by breaking you scanner.
Then you'll have very unhappy people trying to get in and can't.
Another couple of lines of code would give the option to do a manual entry. Say by hitting F8. Or first keying in a Password.
Make it so each manual entry needs a password (thereby annoying the person holding the broken scanner).
Or maybe allow so much time to elapse before manual entries are stopped. Or only allow x number of scans per password.

It late but if I get time I'll try and chunk out a piece of code. but don't hld your breath 'cause i don't get back here often. sorry
Check the net for On Key Events Timer events in VBA VB or even.....QBasic!
good luck.
bruce
 
Upvote 0
If you are printing the bar codes then you can put a hidden character at then beginning; and only allow input if the character is present.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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