CODE 128 barcode in Excel

How to Make CODE 128 in Microsoft Excel

Table of Contents

Some examples how to make CODE 128 barcodes in Excel with StrokeScribe barcode generator without programming and fonts.

For VBA automation and bulk CODE 128 generation, look in the related tutorials.

Requirements

Placing a CODE 128 in Excel Using Active Document

The Active Document-based method is suitable if you need a single CODE 128 with manual data entry. This method does not require any programming, but it is less customizable.

1. Switch to the Insert tab on the Excel Ribbon and click Object.

2. Look for the StrokeScribe Document in the list of available objects:

Inserting a barcode generator in Excel as an Active Document

3. Right-click the barcode object, select StrokeScribe Control->Properties from the context menu.

Setting up a CODE 128 barcode in Excel

CODE 128 Customization

Switch to the Code-specific 2 tab in the barcode properties dialog.

Customizing the CODE 128

The CODE 128 generator supports the following properties:

Placing CODE 128 in Excel using ActiveX

The ActiveX-based barcodes allow automatic data syncing with a chosen worksheet cell. These barcodes are customizable from VBA or from the standard Excel's object property sheet.

1. Click Insert->More Controls on the Developer tab.

2. Select StrokeScribe Control from the list of available objects and press OK:

Inserting CODE 128 in Excel as an ActiveX

3. Click anywhere on the worksheet to insert the barcode object.

4. Activate the Design Mode and open the Properties window:

The Properties button in Excel

5. Use the property list to customize your barcode. To create a CODE 128, modify the following properties:

The barcode property sheet in Excel

Linking the Barcode to a Cell

To automatically update the barcode when a cell content changes, use the linked cell technique.

CODE 128 Customization with VBA

1. Press Alt+F11 to open VBA window. Double-click the current worksheet name in the VBA project tree:

Opening VBA editor in Excel

2. Paste the following code into the VBA editor:

Sub CreateCode128() StrokeScribe1.Alphabet = CODE128 StrokeScribe1.Text = "Any text" ' Optional parameters: StrokeScribe1.FontColor = RGB(0, 0, 255) StrokeScribe1.Rotation = 90 StrokeScribe1.TextBelow = "CODE 128 in Excel" End Sub

3. Place the caret into the CreateCode128() body, press F5 to run the code and switch back to the Excel window to enjoy the barcode.

To encode data from a cell, use the following code:

StrokeScribe1.Text = Range("A1")

To encode a byte array, use the following code:

StrokeScribe1.CodePage = -1 Dim b(1 To 3) As Byte b(1) = &H1 b(2) = &H2 b(3) = &H3 StrokeScribe1.Text = b

To link CODE 128 to a cell or to use non-ActiveX bulk methods, see these tutorials:

© 2025 StrokeScribe. All rights reserved. Use of any portion of this site constitutes acceptance of our Terms of Use and Privacy Policy.
The website material may not be reproduced, except with the prior written permission.

Facebook X Bluesky Youtube Contact Us