Excel Barcode How-Tos


Home > Barcode Excel Add-In > MS Excel Barcode Creating > Excel Barcode Generator for Code 128

Code 128 Barcode Generator Add-In for Excel

How to Generate & Print Code 128 Barcode in Excel Spreadsheets

  • Mature Code 128 generating add-in, suitable for users of Excel 2007 & 2010
  • Capable of generating Code 128 barcode in Excel with 4 directions
  • Flexible to adjust properties of Code 128 in Excel, like image width & height
  • Able to link cells with linear Code 128 barcodes in Excel spreadsheet
  • Compute and add checksum character to Code 128 automatically in Excel
  • Created Code 128 barcodes meet industry standards and support all printers
This guide will show you how to easily turn text and numbers into Code 128 barcodes directly in Microsoft Excel. We'll use a special add-in (a small program that adds new features to Excel) to do this. Think of it as installing a special "printer" inside Excel that creates barcodes instead of printing on paper.


How to Install Code 128 Generator Add-In to Excel

Before you can create barcodes, you need to install the add-in. This is a one-time process.

Preparation

First, you'll need to get the installation file.

Click "Download Now" button on the top page to download the free trial version. This allows you to test all the features before purchasing.

Install

Now, you'll run the installer.
  1. Important Note: Before you start the installation, make sure to close any open Excel applications on your computer. This prevents any conflicts during setup.
  2. Find the downloaded file (usually in your "Downloads" folder) and double-click it to run.
  3. Follow the simple instructions in the setup wizard that appears on your screen. Just click "Next" on each step to proceed with the standard installation.
  4. During the process, your system might ask for permission to allow the program to make changes, or it might prompt you about enabling Excel macros (which are small programs that automate tasks). You should allow these actions, as they are necessary for the add-in to function correctly.

Test the installed software

Let's confirm the installation was successful.
  1. Open your Excel application by clicking its icon on your desktop or from the Start Menu.
  2. Look at the top of the Excel window, in the ribbon (the toolbar with tabs like Home, Insert, and Data). You should now see a new tab labeled Add-ins.
  3. Click on the Add-ins tab. In the ribbon, look for a group named BarcodeLib. If you see this, the installation was a success!


How to Create Your First Code 128 Barcode in Excel?

With the add-in installed, you can now generate your first barcode. We'll create a barcode in cell C4 that is linked to the data you type into cell B4.

Prepare Your Data and Target Cell

  • In your open Excel worksheet, click on cell B4 and type any number or text you want to encode, for example, "ABC-123". This is your source data.
  • Now, click on cell C4. This cell will be highlighted with a bold border, showing it's selected as the location where your new barcode image will appear.

Access and Configure the Barcode Tool

  • Go to the Add-ins tab at the top of the Excel ribbon.
  • In the BarcodeLib group, find and click the button labeled Create Barcode. This action will open the Barcode Settings panel on the right side of your Excel window. This panel is your control center for all barcode options.

Link Your Data and Generate

  • In the Barcode Settings panel, locate the property field labeled Data. Below it, you'll see a text box. Click inside this text box.
  • Here, you need to tell the add-in where to find the information for the barcode. Type the following formula exactly as shown: =LINK(B4). Think of this as creating a bridge that tells the barcode in C4 to always look at cell B4 for its content.
  • Press the Enter key on your keyboard to confirm the formula.
  • In the Barcode Settings panel, find the green Generate button (it usually has a barcode icon next to it). Click this button with your mouse.
  • Look back at cell C4 in your worksheet. You should now see a clear Code 128 barcode! Excel will give it an initial size to fit the cell.



Adjusting the Barcode Size for a Perfect Fit

The initial barcode might be too small or too large for the cell. You can easily make them fit perfectly.
  • Ensure the Barcode Settings panel is still open on the right. If you closed it, go back to the Add-ins tab and click Create Barcode to reopen it.
  • In the panel, find a small checkbox labeled Resize Covered Cell. Click it to put a checkmark in the box. This tells the add-in to automatically adjust the cell's size to match the barcode image.
  • Below this option, locate and click the Update button (usually found next to the Generate button).
  • The add-in will now re-draw the barcode. It will also automatically adjust the width and height of cell C4 so that the barcode fits perfectly inside its borders. Imagine you've drawn a picture on a canvas, and now you're adjusting the canvas frame to fit the picture exactly.


Key Dimension Settings Explained
  • Auto resize

    When checked, the add-in automatically scales the barcode to fit perfectly inside the selected cell.

    For most everyday tasks, you can leave this checked. It simplifies the process.
  • Unit of Measure

    Sets the measurement unit for all size values. Options include Pixel, CM (centimeter), or INCH.

    Choose the unit that matches your document's layout needs. If you're designing a label, inches or centimeters might be easier.
  • Image width / height

    Defines the overall dimensions of the barcode image.

    These fields become editable when "Auto resize" is turned off. You can then type exact values.
  • Bar width (X)

    This is the width of the narrowest bar in the barcode. It is the fundamental building block of your barcode.

    Smaller "X" values create more compact barcodes. However, very narrow bars can be harder for some scanners to read. A medium value is often a safe starting point.
  • Bar height (Y)

    The height of the bars themselves. This does not include the text below the barcode.

    Taller bars are generally easier for scanners to read. You might consider making them tall enough to be easily scanned from various angles.
  • Left/Right margin

    The "quiet zone". The required blank space on either side of the barcode. Scanners need this space to recognize where the barcode starts and ends.

    The recommended minimum quiet zone is 10 times the "X" dimension. It is a good practice to ensure this space is present.



Note: When experimenting with these values, it is a good idea to make small adjustments and test your barcodes with a scanner to ensure they remain readable.


Managing and Updating Your Barcodes

Once your barcode is set up, you'll want to know how to change it or fix it if the data changes.

Automatic Updates (The Easy Way)

The add-in is designed to be smart. As long as the Barcode Settings panel is open on the right side of your Excel window, any change you make to the linked cell will automatically update the barcode.
  • Try it: Double-click cell B4, change the text to something else (e.g., "XYZ-789"), and press Enter. You'll see the barcode in cell C4 update instantly to reflect the new value. No extra clicks are needed!

Manual Updates (When Things Get Out of Sync)

Sometimes, the add-in cannot auto-update. This can happen if:
  • You closed the Excel file and another program changed the data in cell B4.
  • You open the Excel file, but the Barcode Settings panel is closed.

In these cases, you can manually refresh all barcodes at once.
  • Open your Excel file and go to the Add-ins tab. Click Create Barcode to open the Barcode Settings panel.
  • At the bottom of this panel, look for the Update All button and click it.
  • The add-in will scan your entire worksheet and refresh every barcode to match the current data in their linked cells.

Deleting a Barcode

Removing a barcode is simple and can be done in a couple of ways.
  1. In your worksheet, click on the barcode image you wish to remove. You'll know it's selected when a small border with handles appears around it.

    Tip: To delete multiple barcodes at once, hold down the Ctrl key on your keyboard and click each barcode you want to remove.
  2. Once selected, you have three options for deletion:
    • Using the Add-in: If the Barcode Settings panel is open, click the Delete button located near the Generate and Update buttons.
    • Using Your Keyboard: Simply press the Delete key on your keyboard.
    • Using the Right-Click Menu: Right-click on the selected barcode and choose Delete from the menu that appears.
Code 128 Barcode Property Settings
  1. Set the Barcode Type property to CODE 128, CODE 128 A, or CODE 128 B, or CODE 128 C.
    • CODE 128 - default (auto):Barcode Library will automatically switch between code sets to encode the ASCII values.
    • CODE 128 A: Barcode Library will encode the Char Set A which only supports ASCII values from 0 to 95.
    • CODE 128 B: Barcode Library will encode the Char Set B which only supports ASCII values from 32 to 127.
    • CODE 128 C: Barcode Library will encode the Char Set C which only supports pairs of digits.
  2. Set the Data property with the value to encode.
    Type is string.
    1. Valid Data Scope for Code 128 Auto:
      • All 128 characters of ASCII (ASCII values from 0 to 127)
    2. Valid Data Scope for Code 128 Set A :
      • Supports ASCII values from 0 to 95
    3. Valid Data Scope for Code 128 Set B :
      • Supports ASCII values from 32 to 127
    4. Valid Data Scope for Code 128 Set C:
      • Supports pairs of digits
    5. Sample: "BLSample"
  3. Check the Apply Tilde (~) property,, if you want use the tilde character "~" to specify special characters in the input data.
    • ~1: is used to represent the FNC1 code.
    • ~2: is used to represent the Structured Append and must be followed by a 3-digit number between 1 and 255.
    • ~3: is used only at the very beginning of the symbol for the reader programming purpose.
    • ~5: is used only at the very beginning of the symbol, the header [)> + ASCII 30 + ASCII 05 + ASCII 29 will be transmitted by the barcode reader before the data in the message and the trailer ASCII 30 + ASCII 4 will be transmitted afterwards.
    • ~6: is used only at the very beginning of the symbol, the header [)> + ASCII 30 + ASCII 06 + ASCII 29 will be transmitted by the barcode reader before the data in the message and the trailer ASCII 30 + ASCII 4 will be transmitted afterwards.
    • ~7NNNNNN: is used to specify the Extended Channel and NNNNNN is a value between 000000 and 999999.
    • ~dNNN: is used to represent the ASCII character with the value of NNN.
  4. Add checksum char property is not applied here. Barcode Library will always add a check character between encoded data and stop character (modulo 103).
  5. Barcode Size Settings.
    • Set property Unit of Measure (Unit of Measure) for properties Bar Width, Bar Height, Margins.
      Valid values are Pixel, CM, Inch.
    • Set the Image Width and Image Height properties.
      Both types are float.
    • Set the Bar width (X) (for bar cell width) and Bar height (Y) (for bar cell height) properties.
      Both types are float.
    • Set the Left Margin, Right Margin, Top Margin and Bottom Margin properties.
      Types are all float.
    • If the Auto Resize property is chacked, the generated barcode image width and height will be the same as property "Image width", and "Image hight", and it will generate the maximum Bar Width and Bar Hight.
    • Set the DPI property (Value is expressed in DPI - Dots per inch).
      Type is int.
  6. Setting up Barcode data text style in barcode image (Tab: 1D Barcode).
    • Set the Display barcode data properties. If Display barcode data is checked, barcode data will be displayed with the barcode.
    • Set the Font property. The font used to display text in barcode image.
  7. Set Rotate property.
    If you want to rotate barcode image, valid values are : 0, 90, 180, 270


Summary

By following these steps, you can efficiently create, format, and manage Code 128 barcodes in Excel. The key is to remember the =LINK() formula to connect your data and to use the Barcode Settings panel as your main tool for generating and updating the images. The auto-update feature, when active, saves you the most time by keeping everything synchronized effortlessly.





Provides High Quality Java Barcode, Java Barcode Library, Barcode Java, Java Barcode Generator, Java Barcode Generator Library and .NET Barcode Library, ASP.NET Web Barcode Library, C# Barcode Library, VB.NET Barcode Library, .NET Barcode Reader Library, Excel Barcode Software.