Sunday, January 3, 2010

Convert numbers to barcode for FREE

The situation I faced was a user who was manually entering a bunch (over 1,000) of inventory numbers from a spreadsheet into our ERP system. They wanted a way to help avoid errors, while also making it quicker to enter the numbers. Converting the cell values into barcodes would allow the user to scan the barcodes with a barcode scanner, essentially allowing them to cruise through the entry of the numbers with very no chance of typos. Surprisingly, this is very easy to do with the help of a freely available barcode font called Free3of9, which creates a Code 39 bar code for you.

First, download the Free3of9 font from Then unzip the contents and install the fonts on your computer. If you need help, check out my previous post about installing fonts. Once you have Free3of9 installed on your computer, converting numbers to bar codes is as easy as changing the font you're using to Free3of9. However, you must make sure you surround your value with asterisks. This is because the barcode reader needs to know where to start and stop reading, and this particular font uses the asterisk * to send that signal.

A quick way to do this in Excel or Calc is to use the concatenation function. Let's say cell A1 equals 123, and you want to turn that into a barcode. In cell B1, you would enter { ="*"&A1&"*" } (everything inside the brackets {}, but not including them). This would add an asterisk before and after the contents of A1 to create a value of *123* in cell B1. Then change the font used in B1 to be Free3of9 and you'll have a fully readable bar code that will produce the value 123 when read by a barcode reader device.

Good luck, and hopefully this helps save you or someone you know from a lot of manual number entry. You can try this with text, but I haven't tried that so I can't guarantee it will work. I believe you have to use the Free3of9 Extended font, which is included in the download, in order to encode non-number text. The same asterisk rules would apply.

UPDATE 5/3/13

Wow, it's been over 3 years since I originally published this and I've come back to it many times. I have something to add that I ran into today though. If you're using this font in Microsoft Word , be careful. The reason is Word adds a carriage return character at the end of a line of text, and normally you wouldn't see it but this font actually has a value for carriage return so it will encode that into the barcode. If this happens the barcode will not work. I did a mail merge and to get around this problem, after inserting my merge field that was the UPC value, I added a space after it before the end of the line of text and then changed my font to Free 3 of 9. What this does is prevents the system from auto-selecting that carriage return and changing the font on it to Free 3 of 9. You'll know if that happened by looking to the right of the merged field. If you have <> and immediately to the right there shouldn't be any text but you see a barcode, that's because the carriage return font was changed. To fix, either add the space before, or change the font for that little section back to what it originally was. Once I did that the barcodes worked just fine out of Word

No comments: