Generate code39 barcodes in MS Excel Spreadsheet, MS Access Database and Crystal Reports

Keywords: code39 barcode, USD-3, LOGMARS, ISO/IEC 16388:2007

Code39 is also known as 3of9 code, USD-3, and LOGMARS. ISO/IEC 16388:2007 standard defines code39 barcode. Many industries use Code39 barcode.

LOGMARS is the acronym for Logistics Applications of Automated Marking and Reading Symbols. It is a variation of code39. Military Standard MIL-STD-1189B specifies LOGMARS.

Code39 only accepts 43 valid input characters:

26 uppercase alphas (A - Z), digits (0-9), hyphen, period, space, dollar sign, slash, plus and percent.

Code39 will omit other input characters.

Here is the mapping table of Barcodesoft Code39 Barcode Font

Character Mapping
space number sign (#)
hyphen, period, dollar sign
slash, plus, percent
unchanged
0-9 unchanged
A-Z unchanged
Code39 is a self-checking. Therefore, code39 rarely requires a checksum digit. But in applications that require high accuracy, code39 will append a modulo 43 checksum after the data. If you download Barcodesoft code39 demo, you will find source code for checksum calculation.

With Barcodesoft Code39 Font, it is simple to encode code39 barcodes. Just put asterisks (*) before and after your data, then apply one of the following code39 fonts. Code39 barcode will appear.

There are fourteen code39-barcode fonts, as listed below. Each name shows a different aspect ratio. Those code39 fonts with “Hr” in their names have human readable text underneath barcode.

For example, Code39mHr means ‘medium aspect ratio’, with human readable.

Code39XXL means ‘XXL aspect ratio’, without human readable.

Barcodesoft Code39 Demo fonts have “Demo” watermarks.

Barcodesoft Code39 barcode fonts are available in true type, PostScript, PCL, SVG, Open Type (eot),  and Web Open Font Format (woff / woff2). Users can embed Code39 fonts into Adobe PDF files.

Here is the list of Barcodesoft Code39 Barcode Fonts
Aspect Ratio With Human Readable Without Human Readable
XXS Code39XXSHr Code39XXS
XS Code39XSHr Code39XS
S Code39SHr Code39S
M Code39MHr Code39M
L Code39LHr Code39L
XL Code39XLHr Code39XL
XXL Code39XXLHr Code39XXL

Here is the pricing list of Barcodesoft Code39 package
License Single User 10-User Site Corporate Developer Unlimited Developer
Price USD99 USD199 USD399 USD499 USD599 USD1799

Generate Code39 Barcode in Crystal Reports

1. Open your crystal report. Right click Formula Fields, choose "New..." from the context menu.

Type in "Code39" in the Name textbox, then click "Use Editor".

code39 barcode create formula crystal reports

2. From Functions List ==> Additional Functions ==> COM and .NET UFLs (u212com.dll) ==> Visual Basic UFLs, double click "BCSLinearCode39" function from Visual Basic UFLs list as shown.
code39 barcode crystal reports UFL

3. Then type in the database field as parameter for code39 formula. And click "Save" button to save code39 formula field.
4. Drag and drop the Code39 formula field in your crystal report design view.

code39 barcode crystal reports UFL

5. Right click Code39 formula field and choose "Format Field" from context menu. Then choose "Code39mHr" font typeface.

code39 barcode font crystal reports

Click OK button. You will see code39 barcode in your report.

code39 barcode crystal reports

Generate Code39 Barcode in MS Word

1. Start Microsoft® Word®.

2. Type asterisks (*) before and after your data in your Word document.
Please use number sign (#) to replace space characters in your data.

code39 data MS Word

3. Highlight your data. Right click your data and choose Font from context menu. Word will popup a dialog. Please choose Code39Mhr as font.

code39 barcode font MS Word

4. Click OK button. You will get Code39 barcode in your Word document.

code39 barcode in MS Word

Generate Code39 Barcode in MS Excel Spreadsheet

1. Start Microsoft® Excel® first.

If you are using Excel 2000 or 2003, click menu ===> Tools ==> Macro ===> Security. Choose Low security level.
code39 Macro Security

If you are using Excel 2007 / 2010 / 2013 / 2016 / 2019, click the Microsoft Office Button.
Office 2010 button Office 2016 button Office 2019 button
Then click Excel Options, choose Trust Center. In the Macro Settings category, under Macro Settings, choose "Enable all macros" as shown below.

code39 Macro Setting

2. Press ALT + F11 to open Microsoft® Visual Basic editor.
code39 VBA

3. From Visual Basic editor, choose menu Tools ===> References. It will popup a dialog. Click Browse button and choose cruflbcs.dll from your working folder.
Usually it's under C:\Program File\CommonFiles\Barcodesoft\Fontutil folder.
Click the checkbox beside crUFLBcs 1.0 Type Library as shown below. Then click OK button.

code39 add reference

4. Press Ctrl+M, it will popup a dialog, choose barcodesoft.bas under C:\Program File\CommonFiles\Barcodesoft\Fontutil folder. Then click "Open".

If you don't find barcodesoft.bas, please download it from code39.
code39 import vba

5. Close Visual Basic editor and go back to your spreadsheet. Now, you can use one of the following macros to encode data: Code39, Code39Mod43. When you have lots of data to process, you can just copy and paste the macro to the whole column and all data will be encoded in seconds.
=Code39(xxx)
Or you can copy and paste from code snippet below

Public Function Code39(strToEncode As String) As String
Dim obj As cruflBCS.CLinear
Set obj = New cruflBCS.CLinear
Code39 = obj.Code39(strToEncode)
Set obj = Nothing
End Function

Please use cell reference to replace xxx in the formulas as shown below.

code39 barcode excel macro

6. Right click Cell B1, choose Format Cell from context menu. Then click Font to apply one of the appropriate font typefaces to the cell, such as Code39mHr. You will see Code39 barcode in your report.

code39 barcode font typeface crystal reports

Generate Code39 Barcode in MS Access Database

1. Start Microsoft® Access® first.

If you are using Access 2000 or 2003, click menu ===> Tools ==> Macro ===> Security. Choose Low security level.
code39 Access Macro Security

If you are using Access 2007 / 2010 / 2013 / 2016 / 2019, click the Microsoft Office Button.
Office 2010 button Office 2016 button Office 2019 button
Then click Access Options, choose Trust Center. In the Macro Settings category, under Macro Settings, choose "Enable all macros" as shown below.

code39 Access Macro Setting

2. Press ALT + F11 to open Microsoft® Visual Basic editor.
code39 Access VBA

3. From Visual Basic editor, choose menu Tools ===> References. It will popup a dialog. Click Browse button and choose cruflbcs.dll from your working folder.
Usually it's under C:\Program File\CommonFiles\Barcodesoft\Fontutil folder.
Click the checkbox beside crUFLBcs 4.0 Type Library as shown below. Then click OK button.

code39 add reference

4. Press Ctrl+M, it will popup a dialog, choose barcodesoft.bas under C:\Program File\CommonFiles\Barcodesoft\Fontutil folder. Then click "Open".

If you don't find barcodesoft.bas, please download it from code39.
code39 import vba

5. Close Visual Basic and go back to your Access database. Now, create a report in Design view and type in one of the following macros in the field where you want to show code39 barcode before apply font typeface, such as Code39mHr:
=code39([data.code])

Please notice that 'data' is the Table name, 'code' is the Field name.

code39 barcode excel macro

6. Right click the field you want to display code39 barcode. Choose Properties from context menu. Apply one of the appropriate font typefaces to the field, such as code39mHr.

code39 MS Access font

  • code39 barcode download
  • code39 barcode font order