New User? Sign Up  |  Sign In  |  Help
Barcode support and
tutorials from IDAutomation
and the community.
Click for the BBB Business Review of this Computers Hardware, Software & Services in Tampa FL
Resolved Questions

How to create Code 128 barcodes in Excel using VBA using Code 128 Fonts?

How to create Code 128 Barcodes in Excel using your VBA Macros (VBA Font Encoder, VBA formulas, font encoder) and the Code 128 Font Package. The Code 128 Font Package includes fonts named IDAutomationC128 and has a suffix of XS, S, M, L, XL, and XXL to indicate the font height. Only the XS version (extra small) will format properly in Excel because the cells are small.

The VBA encoder determines the character set.

=Code128() creates Code 128 Auto encoding
=Code128a() creates Code 128 A encoding
=Code128b() creates Code 128 B encoding
=Code128c() creates Code 128 C encoding

Operating System: Windows

Application: Excel

06-13-13     11.3 year(s) ago    

  Report Abuse

 

Ben

Best Answer

NOTE: A new product is now available since this issue was resolved that offers a better way to generate barcodes in Excel on Windows and Mac, the IDAutomation Native Generator for Excel.

To create barcodes using a font, two components are required:
(1) Barcode Font – Code 128 Font Package
(2) Font Encoder – Download the VBA (Also available in Step 1)

A barcode font is a file that displays a barcode in text format.

A font encoder is a formula inside of an add-in, plug-in, or source code that performs a calculation to convert data into a format that the barcode font can understand. After the data passes through the font encoder, it is referred to as encoded data. The IDAutomation VBA Macros is a free font encoder that encodes data for Excel and Access.


The steps to import VBA are compatible with Windows Excel 2007 - 2016.


Download and install the Code 128 Font Package (Demo or Sale). Installation assistance on Windows (click here).

1. Download the BarcodeFunctions.zip font encoder to the desired location on your computer. If unsure of where the download is located, run a search on the computer for the name BarcodeFunctions.


2. Right-click the BarcodeFunctions.zip and select Extract All.
image


3. Identify the location of the IDAutomationVBA.bas file.
image


4. Open Excel, select the Developer Tab.
image


5. Select Visual Basic.
image


6. Import the VBA. Select File--Import File and select VBA file.
image


7. Confirm the VBA exists in the Modules folder.
image


NOTE: Only import one instance of the IDAutomationVBA. If multiple IDAutomationVBA files (with the same file name) are in the modules folder, an "ambiguous name error" with #NAME occurs.

8. Select File--Close and Return to Microsoft Excel.

___________________________________________________________

HOW TO ENCODE THE DATA AND CREATE THE BARCODE

Let's encode data for Code 128.
(1) Type data into cell A2.
image

(2) In B2, enter the formula =Code128(
image

(3)Enter the Cell reference and a closed parenthesis.
image

(4) Press enter.
image

(5) Select the IDAutomation Code 128 Font. *
image

*NOTE: In Excel, it may be hard to determine the right barcode font to select. Enter the barcode font name directly into the font selection window. For example, IDAutomationC128M.

Here is a list of demo and licensed fonts. The suffix determines the barcode height. For example, M stands for Medium Height.

DEMO:
IDAutomationSC128XS
IDAutomationSC128S
IDAutomationSC128M
IDAutomationSC128L
IDAutomationSC128XL

LICENSED/SALE:
IDAutomationC128XS
IDAutomationC128S
IDAutomationC128M
IDAutomationC128L
IDAutomationC128XL

For more information on Code 128 Font Specifications, visit:
https://www.idautomation.com/barcode-fonts/code-128/user-manual/#Specifications

Posted 11.3 year(s) ago

(1)
(0)
  Report Abuse
 
Find Interesting
 
Email to Others
 
Bookmark
 
Subscribe to Answer Alert
No comments yet.     Be the first to comment.

Email this question link to friends
You must enter an email address, if name is entered or vice-versa for each friend.
Friend #1 -
Friend #2 -
Friend #3 -
Friend #4 -
Friend #5 -
  Your comment on this question
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allows to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must starts with "http://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always starts with " http:// ")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 Characters are allowed. Current Count: 0
  Your comment on this answer
  |         |  
bold  italic  underline  strike       big  small       superscript  subscript 
  Allow you to add a link. Added links would only be converted to actual clickable link, when the domain of the link is white-listed by administrator.
Caption :
Link URL :
(Must start with "http://" or "https://")
Add  |   Cancel
  Allow to insert an image. Must be among the following file types - *.jpg, *.gif, *.png & *.bmp.
Image Url :   Upload New
(Image url must always start with "http://" or "https://")
Width : pixels
(Must not be greater than 450px. Enter 0px for no resize)
Add  |   Cancel
  Allow to insert YouTube video. Insert the video embed code.
Embed Code :
Add  |   Cancel
Up to 5000 characters are allowed. Current Count: 0

You may answer and comment on any thread according to the Terms and Conditions.

 © Copyright 2021 IDAutomation.com, Inc., All Rights Reserved. Legal Notices.

 Barcode Fonts | Components | Scanners | Support | Contact Us
Training Videos on YouTube Join us on Google Plus Join us on LinkedIn Follow us on Twitter Like us on Facebook