iCheck QR LogoiCheck QR Logo

How to Create Code 128 Barcodes in Excel: A Detailed Guide

Knowledge
July 27, 2025 - 11:33 AM
Share:

Want to generate Code 128 barcodes quickly without using specialized software? With just Excel, you can easily generate Code 128 barcodes using fonts, VBA, or add-ins.

In this article, iCheckQR provides a step-by-step guide on how to create Code 128 barcodes in Excel, suitable for inventory management, label printing, stocktaking, sales, and more.

1. Why Create Code 128 in Excel?

Excel is a familiar tool, ideal for managing and printing barcode labels. It's commonly used in inventory management, product labeling, and tracking goods. The simple spreadsheet interface makes it easy to handle large datasets without requiring deep technical knowledge.

Key Advantages:

  • Generate barcodes in bulk quickly: Just by using formulas or add-ins, you can automatically create multiple Code 128 barcodes for product batches.

  • Easy to use: No need to install complex software. Basic Excel skills are sufficient.

  • Cost-saving: Using Excel reduces software investment costs, especially useful for small businesses or individuals needing to print simple product labels.


Some standout advantages of using Excel to create Code 128 barcodes

2. Methods to Create Code 128 Barcodes in Excel

One of the most common and straightforward methods is to use a barcode font. This doesn’t require any specialized software and can be done right in Excel with a few basic configuration steps.

Method 1: Use Barcode Font to Create Code 128 in Excel (Most Popular)

To convert data into Code 128 barcodes in Excel, follow these steps:

Step 1: Download and install Code 128 font

  • Visit https://www.dafont.com/code-128.font to download the free Code 128 font.

  • After downloading, double-click the .ttf file and click Install to add the font to your system.

Step 2: Open Excel and enter data

  • Open Excel.

  • Enter the numeric string you want to convert into a barcode.

Step 3: Convert to barcode by selecting the font

  • Highlight the entered data.

  • Select the Code 128 font from the font list.

  • Instantly, the content will appear as a Code 128 barcode.


Illustration of creating Code 128 using barcode font in Excel

Note:

  • Code 128 fonts work best when data is encoded according to the standard. Some fonts may require additional start/stop characters or checksums to scan correctly.

  • For advanced needs, consider using dedicated barcode software/tools to automate encoding.

Method 2: Use VBA Macro to Automatically Create Code 128

If you’re working with large datasets, need automation, or require complex logic, using VBA macros in Excel is more efficient than using basic formulas.

Simple Steps:

Step 1: Install Code 128 font

Download “Code128.ttf” from the internet (Google: “Code 128 font free download”). Right-click the .ttf file → click Install.

Step 2: Open the VBA editor

  • Open your Excel file.

  • Press Alt + F11 to open the VBA editor (or go to the Developer tab → click Visual Basic).

  • Click Insert → Module.

  • Paste this code:

Function EncodeCode128(inputStr As String) As String

    ' Add start/stop characters to encode properly with Code128 font

    EncodeCode128 = Chr(204) & inputStr & Chr(206)

End Function

  • Press Ctrl + S to save. Save the file as .xlsm to enable macros.


    Illustration

    Step 3: Create barcode in Excel

    • Example: Column A contains product codes (e.g., A2 = SP001)

    • In cell B2, enter the formula: =EncodeCode128(A2) → Excel will display a special string for barcode generation.

    Step 4: Change font to display the barcode

    • Select the cell with the formula (e.g., B2).

    • Change the font to Code 128.

    • Increase the font size if needed (16–20 pt for better visibility). You’ll see the string become a scannable barcode.

    Reminder:

    • You only need to install the font and paste the VBA code once.

    • If Excel gives a security warning, click Enable Content to activate the macro.

    Method 3: Use Add-ins or External Tools (Optional)

    Besides using fonts or VBA, you can also use specialized add-ins or external tools integrated with Excel to create Code 128 barcodes more conveniently and visually.

    Barcode-generating add-ins:

    • IDAutomation Barcode Add-In for Excel: User-friendly toolbar interface, supports formats like Code 128, Code 39, QR Code, etc.

    • TBarCode Office (by TEC-IT): A powerful add-in that integrates with Excel and Word, supporting 100+ barcode types including Code 128, DataMatrix, PDF417...


      Web interface for barcode creation on TEC-IT

      Advantages:

      • Easy to use: No need for VBA or font knowledge. Just install and select the barcode type from the add-in menu.

      • Supports various barcode types: Not just Code 128, but also EAN, UPC, GS1, QR Code, etc.

      • User-friendly interface: Integrated directly into Excel, works smoothly with spreadsheet data.

      Disadvantages:

      • May require payment: Some add-ins are limited trial versions and need a license for full features.

      • External installation needed: Must download and install from the provider, which might not be feasible on restricted computers.

      Summary: Using add-ins or external tools is ideal for businesses or individuals who frequently generate various barcode types and want quick actions without deep Excel involvement. However, balance convenience against licensing costs when choosing a tool.

      3. Common Errors and Fixes When Creating Code 128 in Excel

      While creating and using Code 128 barcodes in Excel, you may encounter several common issues. Here's a list of common errors and how to fix them:

      Barcode not scannable

      Causes:

      • Missing start or stop characters in the encoded string.

      • Incorrect or unsupported barcode font.

      Fixes:

      • Ensure the barcode string includes appropriate start/stop characters like CHAR(204) and CHAR(206) when using Code128.ttf.

      • Double-check that the correct font is installed and applied in the cell.


      Illustration: Barcode not scannable

      Barcode font not showing in Excel

      Causes:

      • Font not installed properly.

      • Excel hasn't recognized the font after installation.

      Fixes:

      • Verify that the font is successfully installed in your OS (Windows/macOS).

      • Restart Excel after installing the font.

      • Ensure you're selecting the correct font name (e.g., “Code 128” or “IDAutomationC128L”).

      Text appears instead of barcode

      Causes:

      • Cells still use default fonts like Calibri, Arial...

      • Barcode font not applied to result cells.

      Fixes:

      • Select the cells with the barcode string → change to the installed barcode font.

      • Check that the formula or VBA is generating the correct encoded string.

      Scanner not recognizing barcode

      Causes:

      • Barcode too small, blurry, or distorted due to incorrect font size or printing.

      • Inaccurate spacing between bars.

      • Incorrectly formatted Code 128 string.

      Fixes:

      • Increase font size (typically 20pt+ for Code 128).

      • Align properly and avoid cutting barcode edges.

      • Check that input string and formula conform to Code 128 standards.


      Illustration: Scanner not reading the barcode

      Tip: Before mass printing, test scan with a mobile app or actual scanner to ensure the barcode works properly.

      4. Frequently Asked Questions About Creating Code 128 in Excel

      Can I create Code 128 in Excel without VBA?

      Yes. You can absolutely create Code 128 barcodes in Excel using only barcode fonts and simple formulas—no VBA required.

      The most popular method involves combining strings with special characters (start/stop) and fonts like Code128.ttf. This is perfect for non-programmers or simple data tasks.

      Are barcode fonts free for commercial use?

      It depends on the font. Some barcode fonts like Free3of9.ttf or Code128 variants are free for personal use but may require payment or licensing for commercial environments.

      Recommendation:

      • Always read the usage terms when downloading fonts from third-party websites.

      • For professional commercial use, consider purchasing licensed fonts from providers like IDAutomation, TEC-IT...

      Can I print barcodes directly from Excel?

      Yes. Once you've successfully created the barcodes in Excel (using font or VBA), you can print them directly like any spreadsheet.

      However, make sure:

      • The barcode font is installed on the printing computer.

      • Font size is large enough for the barcode to be sharp and scannable.

      • Do a test print first to avoid sizing or margin errors affecting the barcode.

      You can create Code 128 barcodes in Excel using three methods: font, VBA macro, or add-in. Each method helps you quickly generate and print barcodes. Always test with a real scanner before mass printing to ensure functionality. If you need to create many barcodes, consider saving a template file or using macros for automation.

      Last update: November 14, 2025 - 2:30 PM

      iCheckQR Team

      iCheckQR Team

      Content compiled by the iCheckQR team, specializing in encoding, QR codes, and digital product applications. We are committed to providing accurate, easy-to-understand, and useful information tailored to the practical implementation needs of users.

      Make a QR code for your daily use.

      You May Also Like