Generate code39 Barcodes

Implement seamlessly across Crystal Reports, MS Excel, and MS Access

Generate code39 Barcode in MS Excel Spreadsheet

Generate Code 39 barcodes directly in MS Excel using Barcodesoft's cruflbcs.dll and TrueType fonts. After enabling macros and registering the DLL via the VBA editor, import the barcodesoft.bas module to access the =code39() formula. Simply wrap your data with asterisks or use the provided VBA function—then copy the formula across your entire dataset for instant encoding. Apply one of 14 TrueType fonts (available with or without human-readable text, ranging from XXS to XXL aspect ratios) to any cell, and your scannable Code 39 barcodes are ready. Perfect for logistics, military, and industrial labeling, this solution integrates seamlessly into your existing Excel workflow.

Step 1. Initialize Trust Macro Settings

For Excel 2007 / 2010 / 2013 / 2016 / 2019 / 2021 / 2024 / 365: Click Office Menu File options → Trust Center → Trust Center Settings → Macro Settings, select "Enable all macros".

VBA Macro Security Settings View

Legacy Office (2000/2003): Navigate via Tools → Macro → Security, configure to Low.

Step 2. Launch Visual Basic Window

Press ALT + F11 continuously to call up the integrated VBA Editor dashboard pane.

Step 3. Establish Library Reference Connections

Within the editor, click Tools → References. In the browse lookup prompt path window, point directory target path location directly towards cruflbcs.dll module file assets (typically positioned inside C:\Program Files (x86)\Common Files\Barcodesoft\Fontutil directory folders). Ensure checkmark selection for crUFLBcs 5.0 Type Library is confirmed.

VBA library import dialog step

Step 4. Import Module Automation Macros

Press Ctrl + M to open the file import window context panel. Choose barcodesoft.bas file layout components from the utilities pathway mentioned above. If missing, retrieve package sources over archive zip links at cruflbcs.zip.

VBA module layout architecture

Step 5. Implement Column Formula Configurations

Close the Visual Basic layout editor to return focus back to spreadsheets workspace grid panels. Execute processing expressions inside desired workbook rows via standard cells referencing syntax parameters:

=code39(A1)
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

Close Visual Basic editor and go back to your spreadsheet. Now, you can use the following macros to encode data: code39 . 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 immediately.

Excel calculations view cells blueprint

Step 6. Set code39 Barcode Font Style Properties

Right-click the targeting output reference cell field (e.g. B1), choosing "Format Cells" properties. Under Font settings tabs layout mapping options select typeface identifier name tags tracking UpcEanM. Ensure the font style is set to Regular with Underline set to None.

Font configuration panel view mapping rules

Step 7. Click OK and you should be able to see code39 barcode in your Excel spreadsheet now.
The package includes 14 TrueType fonts in a variety of sizes and styles:
With human-readable text: Code39XXL, Code39XL, Code39L, Code39M, Code39S, Code39XS, and Code39XXS;
Without human-readable text: Code39XXL, Code39XL, Code39L, Code39M, Code39S, Code39XS, and Code39XXS.
Each font is designed with a different aspect ratio, allowing you to select the one that best suits your application requirements.