Generate ITF-14 Barcodes in Excel Easily – Step-by-Step Guide
Tags: Excel, ITF-14, manually, formula, VBAAn example how to insert ITF-14 barcode in Excel with StrokeScribe barcode generator.
For more examples including bulk barcode generation, look in the related tutorials.
Requirements
- Download and install the barcode generator
Placing ITF-14 as an Active Document
The method is good when you need a single ITF-14 barcode with manual data entry. This method does not require programming, but it is less customizable.
1. Switch to the Insert tab on the Ribbon and click Object.

2. Look for the StrokeScribe Document in the list:
3. Right-click the barcode object, select StrokeScribe Control->Properties from the context menu.

- Switch to the General tab;
- Set Alphabet = ITF-14;
- Enter the barcode data into the Text field.
ITF-14 Customization
Switch to the Code-specific 2 tab in the barcode properties dialog.

The ITF-14 generator supports the following properties:
- ITF14BearerBox - changes the bearer type (rectangular/linear);
- ITF14BearerWidth - changes the bearer width.
Placing ITF-14 in Excel with formula
1. Open the VBA window (Alt+F11) and create a standard module (VBAProject->Insert->Module). Do not use a worksheet or a workbook module - the formula will not call a function from there.
2. Paste the following code into the module:
Function CreateBarcode(data As String) As String
Dim AC As Range
Set AC = Excel.Application.Caller
Dim wsh As Worksheet
Set wsh = AC.Worksheet
shname = "barcode_" & AC.Address()
On Error Resume Next
wsh.Shapes(shname).Delete
On Error GoTo 0
bar_w = AC.MergeArea.Width
bar_h = AC.MergeArea.Height
Dim ss As StrokeScribeClass
Set ss = CreateObject("STROKESCRIBE.StrokeScribeClass.1")
ss.Alphabet = ITF14
ss.ITF14BearerBox = True
ss.ITF14BearerWidth = 1
ss.Text = data
image_path = Environ("TEMP") & "\barcode.wmf"
rc = ss.SavePicture(image_path, WMF, 1440, 1440 / (bar_w / bar_h))
If rc > 0 Then
CreateBarcode = ss.ErrorDescription
Exit Function
End If
Dim shp As Shape
Set shp = wsh.Shapes.AddPicture(image_path, msoFalse, msoTrue, AC.Left, AC.Top, bar_w, bar_h)
shp.Name = shname
Kill image_path
CreateBarcode = ""
End Function
3. Add a reference to the StrokeScribe Class into your VBA project.
4. Switch back to the Excel window. Choose a cell and type in the formula field:
=CreateBarcode("1234567890123")
or =CreateBarcode(A1)
