|
Data Matrix Excel Barcode Generator Add-In
How to Generate Data Matrix Barcode in Excel 2019/2016/2013/2010/2007
- Excellent Excel Data Matrix generator plug-in for Microsoft Excel users
- Complete the installation only by clicking the setup file, without activation keys
- Adjust Data Matrix barcode settings easily and flexibly in MS Excel spreadsheet
- Easy to link the Data Matrix barcode images with the data in the Excel cells
- Generated Data Matrix barcode images are compatible with latest industry criteria
- Also suitable for other linear and 2D barcode generation in Microsoft Office Excel
Welcome! This guide will walk you through the process of generating Data Matrix barcodes directly inside your Excel spreadsheets. Whether you need to encode product serial numbers, asset tracking codes, or complex GS1 data, the BarcodeLib Excel Barcode Generator Add-in makes this task straightforward.
Think of a Data Matrix barcode as a tiny, high-capacity storage unit. Similar to a QR code, but often smaller and more compact. It can pack a surprising amount of information (like serial numbers, URLs, or even international text) into a square or rectangle that scanners can read instantly.
Getting the Barcode Add-in Installed

Before we can create barcodes, we need to install the tool that will do the work inside Excel. This is a one-time setup.
Download the Installer
- Click button "Download Now" on the top right of this page
Run the Installation
- Open your "Downloads" folder and double-click the downloaded .exe file.
- You might see a security warning. This is normal. Click "Yes" or "Run" to proceed.
- Follow the on-screen instructions. Typically, you can click "Next" a few times, then "Install", and finally "Finish".
- Note: It's a good idea to close any open Excel windows before installing to ensure the setup completes successfully.
Verify the Installation
- Open a new or existing Excel workbook.
- Look at the ribbon at the top of Excel. You should see a new tab labeled Add-ins. Click on it.
- In the BarcodeLib group, you should now see a button called Create Barcode. If you see this button, the installation was successful.
Creating Your First Data Matrix Barcode

Now, let's create a Data Matrix barcode that encodes text from a specific cell. This is the most common and useful approach.
Set Up Your Data
- Click on cell A2 in your worksheet.
- Type some sample text, for example: Product-123. This is the information we want to encode inside the barcode.
- Press Enter to confirm.
Generate the Barcode
- Open the Barcode Panel:
- Go to the Add-ins tab on the Excel ribbon.
- In the BarcodeLib group, click the Create Barcode button.
- A panel titled "Barcode Settings" will appear on the right side of your Excel window. This is your control center for all barcode-related tasks.
- Select the Destination Cell:
Click on cell B2. This is where the barcode image will be placed.
- Configure the Barcode Type:
- In the "Barcode Settings" panel, find the dropdown menu labeled Barcode Type at the top.
- Click it and scroll down to select Data Matrix / GS1 Data Matrix.
- Link to Your Data Cell:
- Look for the text box labeled Data in the panel.
- You'll notice it automatically shows =LINK(B2). This is a formula that tells the barcode to encode whatever is in cell B2.
- Key Action: Change this value to =LINK(A2) .
- Analogy: Think of =LINK(A2) as a digital leash. It connects the barcode to cell A2, so whenever the text in A2 changes, the barcode updates automatically.
- Generate the Barcode:
Click the Generate button at the bottom of the panel.
Test Your Barcode
- You should now see a Data Matrix barcode image appear in cell B2.
- Look closely at the barcode. It should encode the text "Product-123" from cell A2.
- To test the link, go back to cell A2, change the text to something else (e.g., Item-456), and press Enter.
- The barcode in cell B2 should automatically update to encode the new text.
Note: If the barcode doesn't update, double-check that you typed =LINK(A2) exactly, with the equals sign and parentheses. Also ensure cell B2 is still selected when you make changes.
Generating Multiple Data Matrix Barcodes (Batch Creation)

Creating one barcode is useful, but what if you have a whole list of items in column A? Doing this manually for each row would be time-consuming. Here's the efficient way to create multiple barcodes at once.
Set Up Your Data List and Template
- Prepare Your Data List: In column A, starting from cell A2 and going down, enter all the data you want to encode. For example:
- A2: Product-123
- A3: Item-456
- A4: Asset-789
- A5: Part-ABC
-
Create Your Template Barcode: Ensure you have your first barcode in cell B2, properly linked to A2, as we created in Part 2. This barcode will serve as our master template. All the customizations (like size or font) applied to this template will be copied to the new barcodes.
Duplicate the Barcodes
- Select the Template:
- Click on the barcode in cell B2.
- Look at the "Barcode Settings" panel. You should see a message indicating it's the source, for example: "Copy from: Cell [B2] Data Matrix". This confirms the add-in knows which barcode to copy.
- Select Multiple Destination Cells:
- Click on cell B3.
- Hold down the Shift key on your keyboard.
- While holding Shift, click on cell B5. This will select the entire range B3, B4, and B5 simultaneously.
- Find the Correct Button:
- In the "Barcode Settings" panel, look for two buttons near the bottom: Duplicate and Duplicate All.
- Since you have multiple cells selected, click the Duplicate All button.
Check the Results
- Look at cells B3, B4, and B5. New Data Matrix barcodes should now appear in each of these cells.
- Check that the barcode in B3 encodes the text from A3, the barcode in B4 encodes A4, and so on. The add-in automatically links each new barcode to its neighboring cell in column A.
Pro Tip: If you only need to create one additional barcode, you can select a single destination cell (like B3) and click the Duplicate button instead of Duplicate All.
Understanding What Data Matrix Can Encode

Data Matrix is a versatile symbology (barcode type). Here's a closer look at the types of data you can put inside those squares.
- ASCII Printable Characters (Everyday Text)
- You can encode standard keyboard characters: letters (A-Z, a-z), digits (0-9), and punctuation marks (!, @, #, $, etc.). These are known as ASCII characters with values from 32 to 126.
- How to do it: Simply type them directly into the Data text box in the panel, or put them in a linked Excel cell (like A2). The add-in handles the conversion automatically.
- Unicode Characters (International Text)
- Need to encode names or addresses with accents (é, ñ, ü) or characters from other alphabets (like Cyrillic, Arabic, or Chinese)? Data Matrix supports Unicode.
- How to do it:
- Select your barcode image.
- In the "Barcode Settings" panel, go to the 2D Barcode tab.
- Find the dropdown menu labeled Data mode. Change it from "AUTO" to BASE256. This mode is designed for handling byte data, which includes Unicode text.
- Below that, find the property labeled Encode for bytes. We recommend leaving this as UTF-8, as it's the most widely compatible encoding for barcode scanners.
- In the Data box (or a linked cell), enter your Unicode text.
- Click the Update button to regenerate the barcode.
- GS1 Data Message (For Retail and Supply Chain)
- If you work in industries that use GS1 standards (like retail, healthcare, or logistics), you can create GS1-compatible Data Matrix barcodes. These encode data elements like GTINs (Global Trade Item Numbers), expiry dates, and batch numbers, each identified by an Application Identifier (AI).
- How to do it: You'll need to format your data with parentheses around the AIs. For example: (01)12345678901231(17)231231(10)ABC123. The add-in can process this format when you have Data Matrix / GS1 Data Matrix selected as the barcode type. You can also look for a GS1 Compatible Barcode checkbox, typically found on the 2D Barcode tab, and ensure it's checked.
Adjusting the Size of Your Data Matrix Barcode

Data Matrix barcodes come in two main shapes: square and rectangle. You have control over their size.
For Square Data Matrix Barcodes
- Select the Image: Click on your Data Matrix barcode in the worksheet.
- Find the Size Settings: In the "Barcode Settings" panel, go to the Barcode Size tab.
- Locate the Options: Look for the Image width and Image height boxes, which are in the "Width & Height" group.
- Adjust the Values: You can type new pixel values directly into these boxes. For a square, make sure the width and height are the same number.
- Apply the Change: Click the Update button. The add-in will redraw the barcode at your new specified size.
For Rectangular Data Matrix Barcodes
The Data Matrix specification includes several standard rectangle formats, such as 8x18, 12x26, or 16x48 (where the numbers refer to the count of rows and columns of modules).
- Select the Image: Click on your Data Matrix barcode.
- Find the Format Mode: In the "Barcode Settings" panel, go to the 2D Barcode tab.
- Locate the Option: Look for the dropdown menu labeled Format mode.
- Choose a Rectangle Format: Select a rectangular option from the list, for example, 12x36.
- Adjust the Image Size Proportionally:
- When you choose a rectangle format, the image's width and height must match the aspect ratio of that format.
- For the 12x36 format, there are 12 rows and 36 columns. This means the image width should be three times its height (36 divided by 12 equals 3).
- Go back to the Barcode Size tab. In the Image width box, enter a value like 1536 pixels. In the Image height box, enter 512 pixels (since 512 multiplied by 3 equals 1536).
- Apply the Change: Click the Update button. The add-in will generate a crisp, rectangular Data Matrix barcode at your specified dimensions.
Important Note: If you enter a width and height that don't match the selected format's aspect ratio, the add-in may not generate the barcode correctly, or it might create an image with an error message. It's best to calculate the dimensions beforehand to ensure they are proportional.
Data Matrix Characteristics and Settings Reference

Here's a quick guide to the technical details of Data Matrix barcodes and where to find the corresponding settings in the panel.
Encodable Characters (What Can I Put Inside?)
- Standard ASCII: Values 0 to 127. This includes basic English letters, numbers, and control characters.
- Extended ASCII: Values 128 to 255. This includes characters like ©, ®, and accented letters common in Western European languages (e.g., é, ñ, ü).
- Other Languages and Symbols: You can encode characters from Arabic, Cyrillic, Greek, Hebrew, Chinese, and other scripts. This is achieved by using the BASE256 data mode and UTF-8 encoding, as described in Part 4.
Data Mode (How the Barcode Compresses Your Text)
This setting tells the barcode how to efficiently pack your data into its grid of black and white modules. Unless you have a specific reason to choose another option, we recommend using "AUTO".
- Where to find it: Select your barcode, go to the 2D Barcode tab, and look for the Data mode dropdown menu.
- AUTO (Recommended): The software analyzes your text automatically and chooses the most efficient encoding mode. This is the best choice for most users, as it simplifies the process.
- ASCII: Optimized for data that is mostly standard ASCII characters (values 0-127).
- C40: Designed for data that is primarily numbers and UPPERCASE letters. It compresses this type of data very efficiently.
- TEXT: Designed for data that is primarily numbers and lowercase letters.
- X12: Used specifically for ANSI X12 EDI (Electronic Data Interchange) data sets.
- EDIFACT: Used for UN/EDIFACT data, another EDI standard.
- BASE256: Used for byte data, which includes Unicode text, binary files, and any data outside the standard ASCII range.
Maximum Character Capacity (How Much Can I Fit?)
The amount of data you can encode depends on the size of the Data Matrix symbol and the type of characters. For the largest available Data Matrix symbol, the limits are:
- Numeric data only (digits 0-9): Up to 3,116 digits
- Alphanumeric data (letters and numbers): Up to 2,335 characters
- Byte data (8-bit, like Unicode): Up to 1,555 characters
Important Note: If you try to encode more data than the maximum allowed for a given symbol size, the add-in will not generate a valid barcode. Instead, it will create an image with an error message like "Invalid Barcode Settings" printed on it. If you see this, you can try reducing the amount of data, or consider using a different barcode type (like PDF417) that supports larger data capacities.
Data Matrix Barcode Property Settings
- Set the Barcode Type property to DATAMATRIX
- Set the Data property with the value to encode.
Type is string.
- Valid Data Scope:
- All 128 characters of ASCII
- Sample: "123456789012"
- Set the Data mode property.
Valid value is
AUTO,
ASCII,
C40,
Text,
X12,
EDIFACT
BASE256.
- ASCII: it is used to encode data that mainly contains ASCII characters (0-127).
- C40: it is used to encode data that mainly contains numeric and upper case characters.
- Text: it is used to encode data that mainly contains numeric and lower case characters.
- Base256: it is used to encode 8 bit values.
- Set the Format mode property for Data Matrix data mode format. Specifies the Data Matrix Format to use on that barcode.
- Check the GS1 Compatible Barcode property, if you need generate GS1 barcodes.
- 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.
- Barcode Size Settings.
- Set property Unit of Measure (Unit of Measure) for properties Bar Width, 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) property.
The type is 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.
Summary

Here's a simple map to help you find specific options quickly in the "Barcode Settings" panel:
- To choose the barcode type (Data Matrix): Look at the very top of the panel for the Barcode Type dropdown menu.
- To set or change the data source (the =LINK() formula): Look for the Data text box, located just below the barcode type.
- To enable GS1 mode: Look for the GS1 Compatible Barcode checkbox. This is typically found on the 2D Barcode tab.
- To change the data mode (AUTO, ASCII, BASE256, etc.): Go to the 2D Barcode tab and find the Data mode dropdown menu.
- To choose a specific symbol size (e.g., 12x36 rectangle): Go to the 2D Barcode tab and find the Format mode dropdown menu.
- To adjust the image width and height precisely: Go to the Barcode Size tab and look for Image width and Image height in the "Width & Height" group.
- To change the color of the bars or make the background transparent: Look for color picker options, which are often found on a dedicated Colors tab or within the main settings area of the panel.
| |