SlideShare a Scribd company logo
barcodelive.org
table of content
1 2
What Is Code 128
Barcode Font?
How to Generate
Code 128 Barcode
Font for Excel?
1
Code 128 Barcode Font is a type of barcode font that
allows users to create code 128 barcodes in Excel
WHAT IS CODE 128
BARCODE FONT?
barcodelive.org
A high-density linear
barcode that can hold large
amounts of data in a
compact format
Easy to install & use and
can be integrated into a wide
range of applications
Code128 Code128font
CODE 128
THREE SUBSETS
Code 128A: for alphanumeric data (uppercase
letters, numbers & control characters)
Code 128B: for full ASCII data (uppercase
and lowercase letters, numbers & symbols)
Code 128C: for numeric-only data
barcodelive
2 How to Generate
Code 128 Barcode
Font for Excel?
Download Code 128 Font
and extract the downloaded
folder into the
C:WindowsFonts folder
Turn on the Excel's
Developer module
Step1 Step2
Barcode
Barcode
String
Barcode
Presentation
Check
X X X X
Step3
Make a new Excel sheet in Microsoft with the following titles &
structure
Choose Visual Basic
from the Developer tab
on the ribbon to launch
the Visual Basic window
Step4
Step5
Right-click & choose "Insert Module." Then,
paste a code
Option Explicit
Public Function Code128(SourceString As String)
'Written by Philip Treacy, Feb 2014
'http://www.myonlinetraininghub.com/create-barcodes-with-excel-vba
'This code is not guaranteed to be error free. No warranty is implied or expressed. Use at your own risk and carry
out your own testing
'This function is governed by the GNU Lesser General Public License (GNU LGPL) Ver 3'Input Parameters : A
string
'Return : 1. An encoded string which produces a bar code when dispayed using the CODE128.TTF font
' 2. An empty string if the input parameter contains invalid characters
Dim Counter As Integer
Dim CheckSum As Long
Dim mini As Integer
Dim dummy As Integer
Dim UseTableB As Boolean
Dim Code128_Barcode As String
If Len(SourceString) > 0 Then
'Check for valid charactersFor Counter = 1 To Len(SourceString)
Select Case Asc(Mid(SourceString, Counter, 1))
Case 32 To 126, 203Case Else
MsgBox "Invalid character in barcode string." & vbCrLf & vbCrLf & "Please only use standard ASCII
characters", vbCritical
Code128 = ""Exit FunctionEnd SelectNext
Code128_Barcode = ""
UseTableB = True
Counter = 1Do While Counter <= Len(SourceString)
If UseTableB Then'Check if we can switch to Table C
mini = IIf(Counter = 1 Or Counter + 3 = Len(SourceString), 4, 6)
GoSub testnum
If mini% < 0 Then 'Use Table C
If Counter = 1 Then
Code128_Barcode = Chr(205)
Else 'Switch to table C
Code128_Barcode = Code128_Barcode & Chr(199)
End If
UseTableB = False
Else
If Counter = 1 Then Code128_Barcode = Chr(204) 'Starting with table B
End IfEnd IfIf Not UseTableB Then'We are using Table C, try to process 2 digits
mini% = 2
GoSub testnum
If mini% < 0 Then 'OK for 2 digits, process it
dummy% = Val(Mid(SourceString, Counter, 2))
dummy% = IIf(dummy% < 95, dummy% + 32, dummy% + 100)
Code128_Barcode = Code128_Barcode & Chr(dummy%)
Counter = Counter + 2Else 'We haven't got 2 digits, switch to Table B
Code128_Barcode = Code128_Barcode & Chr(200)
UseTableB = TrueEnd IfEnd IfIf UseTableB Then'Process 1 digit with table B
Code128_Barcode = Code128_Barcode & Mid(SourceString, Counter, 1)
Counter = Counter + 1
End If
Loop
'Calculation of the checksumFor Counter = 1 To Len(Code128_Barcode)
dummy% = Asc(Mid(Code128_Barcode, Counter, 1))
dummy% = IIf(dummy% < 127, dummy% - 32, dummy% - 100)
If Counter = 1 Then CheckSum& = dummy%
CheckSum& = (CheckSum& + (Counter - 1) * dummy%) Mod 103Next'Calculation of the checksum ASCII code
CheckSum& = IIf(CheckSum& < 95, CheckSum& + 32, CheckSum& + 100)
'Add the checksum and the STOP
Code128_Barcode = Code128_Barcode & Chr(CheckSum&) & Chr$(206)
End If
Code128 = Code128_Barcode
Exit Function
testnum:
'if the mini% characters from Counter are numeric, then mini%=0
mini% = mini% - 1
If Counter + mini% <= Len(SourceString) Then
Do While mini% >= 0
If Asc(Mid(SourceString, Counter + mini%, 1)) < 48 Or Asc(Mid(SourceString, Counter + mini%, 1)) > 57 Then Exit
Do
mini% = mini% - 1
Loop
End If
Return
End Function
Step6
Insert =Code128([@Barcode]) into cell B2 ("Barcode String").
Insert =[@[Barcode String]] into cell C2 ("Barcode
Presentation").
Insert the following code in cell D2 ("Check"):
=IF(ISNUMBER(SEARCH("Â",[@[Barcode
Presentation]],1)),"Error!","")
Reopen your Excel document and add the following formulas:
Step7
Highlight Column C & change
the font to “Code 128”.
Now when you enter data into
cell A2, a barcode should be
displayed in cell C2 and so-on
down the entire sheet.
Thank you!
barcodelive.org

More Related Content

Similar to Slide_code 128 barcode font for excel (1).pdf

Lecture # 1 - Introduction Revision - 1 OOPS.pptx
Lecture # 1 - Introduction  Revision - 1 OOPS.pptxLecture # 1 - Introduction  Revision - 1 OOPS.pptx
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
SanaullahAttariQadri
 
C Programming Language
C Programming LanguageC Programming Language
C Programming Language
RTS Tech
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
GrejoJoby1
 
computer architecture
computer architecture computer architecture
computer architecture
Dr.Umadevi V
 
Lesson 13. Pattern 5. Address arithmetic
Lesson 13. Pattern 5. Address arithmeticLesson 13. Pattern 5. Address arithmetic
Lesson 13. Pattern 5. Address arithmetic
PVS-Studio
 
Chapter Eight(1)
Chapter Eight(1)Chapter Eight(1)
Chapter Eight(1)bolovv
 
Lecture # 1 introduction revision - 1
Lecture # 1   introduction  revision - 1Lecture # 1   introduction  revision - 1
Lecture # 1 introduction revision - 1
SajeelSahil
 
Code 128 check digit calculator_slide.pdf
Code 128 check digit calculator_slide.pdfCode 128 check digit calculator_slide.pdf
Code 128 check digit calculator_slide.pdf
Barcode Live
 
A nice 64-bit error in C
A  nice 64-bit error in CA  nice 64-bit error in C
A nice 64-bit error in C
PVS-Studio
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
Abdul Haseeb
 
Data types in c++
Data types in c++ Data types in c++
Data types in c++
RushikeshGaikwad28
 
Development of a static code analyzer for detecting errors of porting program...
Development of a static code analyzer for detecting errors of porting program...Development of a static code analyzer for detecting errors of porting program...
Development of a static code analyzer for detecting errors of porting program...
PVS-Studio
 
90 Informatics Practices.pdf
90 Informatics Practices.pdf90 Informatics Practices.pdf
90 Informatics Practices.pdf
vikas500500
 
Advanced Topics On Sql Injection Protection
Advanced Topics On Sql Injection ProtectionAdvanced Topics On Sql Injection Protection
Advanced Topics On Sql Injection Protection
amiable_indian
 
Unit i intro-operators
Unit   i intro-operatorsUnit   i intro-operators
Unit i intro-operators
HINAPARVEENAlXC
 
Control flow Graph
Control flow GraphControl flow Graph
Control flow Graph
Md Arif Hasan
 
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Julien Le Dem
 
Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Cloudera, Inc.
 
Moving Average Filter in C
Moving Average Filter in CMoving Average Filter in C
Moving Average Filter in C
Colin
 

Similar to Slide_code 128 barcode font for excel (1).pdf (20)

Lecture # 1 - Introduction Revision - 1 OOPS.pptx
Lecture # 1 - Introduction  Revision - 1 OOPS.pptxLecture # 1 - Introduction  Revision - 1 OOPS.pptx
Lecture # 1 - Introduction Revision - 1 OOPS.pptx
 
C Programming Language
C Programming LanguageC Programming Language
C Programming Language
 
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo JobyC++ and OOPS Crash Course by ACM DBIT | Grejo Joby
C++ and OOPS Crash Course by ACM DBIT | Grejo Joby
 
computer architecture
computer architecture computer architecture
computer architecture
 
Lesson 13. Pattern 5. Address arithmetic
Lesson 13. Pattern 5. Address arithmeticLesson 13. Pattern 5. Address arithmetic
Lesson 13. Pattern 5. Address arithmetic
 
Chapter Eight(1)
Chapter Eight(1)Chapter Eight(1)
Chapter Eight(1)
 
C++ programming
C++ programmingC++ programming
C++ programming
 
Lecture # 1 introduction revision - 1
Lecture # 1   introduction  revision - 1Lecture # 1   introduction  revision - 1
Lecture # 1 introduction revision - 1
 
Code 128 check digit calculator_slide.pdf
Code 128 check digit calculator_slide.pdfCode 128 check digit calculator_slide.pdf
Code 128 check digit calculator_slide.pdf
 
A nice 64-bit error in C
A  nice 64-bit error in CA  nice 64-bit error in C
A nice 64-bit error in C
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
 
Data types in c++
Data types in c++ Data types in c++
Data types in c++
 
Development of a static code analyzer for detecting errors of porting program...
Development of a static code analyzer for detecting errors of porting program...Development of a static code analyzer for detecting errors of porting program...
Development of a static code analyzer for detecting errors of porting program...
 
90 Informatics Practices.pdf
90 Informatics Practices.pdf90 Informatics Practices.pdf
90 Informatics Practices.pdf
 
Advanced Topics On Sql Injection Protection
Advanced Topics On Sql Injection ProtectionAdvanced Topics On Sql Injection Protection
Advanced Topics On Sql Injection Protection
 
Unit i intro-operators
Unit   i intro-operatorsUnit   i intro-operators
Unit i intro-operators
 
Control flow Graph
Control flow GraphControl flow Graph
Control flow Graph
 
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
Efficient Data Storage for Analytics with Parquet 2.0 - Hadoop Summit 2014
 
Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0Efficient Data Storage for Analytics with Apache Parquet 2.0
Efficient Data Storage for Analytics with Apache Parquet 2.0
 
Moving Average Filter in C
Moving Average Filter in CMoving Average Filter in C
Moving Average Filter in C
 

More from Barcode Live

WeChat QR code scanner
WeChat QR code scanner WeChat QR code scanner
WeChat QR code scanner
Barcode Live
 
stock barcoding good or bad (1).pdf
stock barcoding good or bad (1).pdfstock barcoding good or bad (1).pdf
stock barcoding good or bad (1).pdf
Barcode Live
 
How to Make a Scannable QR Code
How to Make a Scannable QR CodeHow to Make a Scannable QR Code
How to Make a Scannable QR Code
Barcode Live
 
how to create a barcode for a product (1).pdf
how to create a barcode for a product (1).pdfhow to create a barcode for a product (1).pdf
how to create a barcode for a product (1).pdf
Barcode Live
 
barcode generator ean-13 (1).pdf
barcode generator ean-13 (1).pdfbarcode generator ean-13 (1).pdf
barcode generator ean-13 (1).pdf
Barcode Live
 
free online barcode generator excel (1).pdf
free online barcode generator excel (1).pdffree online barcode generator excel (1).pdf
free online barcode generator excel (1).pdf
Barcode Live
 
do qr codes have to be black and white (1).pdf
do qr codes have to be black and white (1).pdfdo qr codes have to be black and white (1).pdf
do qr codes have to be black and white (1).pdf
Barcode Live
 
Do QR Codes Expire (1).pdf
Do QR Codes Expire (1).pdfDo QR Codes Expire (1).pdf
Do QR Codes Expire (1).pdf
Barcode Live
 
will we run out of QR codes (1).pdf
will we run out of QR codes (1).pdfwill we run out of QR codes (1).pdf
will we run out of QR codes (1).pdf
Barcode Live
 
can you change a qr code link (1).pdf
can you change a qr code link (1).pdfcan you change a qr code link (1).pdf
can you change a qr code link (1).pdf
Barcode Live
 
what does qr mean in qr codes (1).pdf
what does qr mean in qr codes (1).pdfwhat does qr mean in qr codes (1).pdf
what does qr mean in qr codes (1).pdf
Barcode Live
 
what does the ce on products mean (1).pdf
what does the ce on products mean (1).pdfwhat does the ce on products mean (1).pdf
what does the ce on products mean (1).pdf
Barcode Live
 
what is the country of origin (1).pdf
what is the country of origin (1).pdfwhat is the country of origin (1).pdf
what is the country of origin (1).pdf
Barcode Live
 
barcode country of origin list (1).pdf
barcode country of origin list (1).pdfbarcode country of origin list (1).pdf
barcode country of origin list (1).pdf
Barcode Live
 
country of origin certificate (1).pdf
country of origin certificate (1).pdfcountry of origin certificate (1).pdf
country of origin certificate (1).pdf
Barcode Live
 
inventory barcode scanners (1).pdf
inventory barcode scanners (1).pdfinventory barcode scanners (1).pdf
inventory barcode scanners (1).pdf
Barcode Live
 
Amazon fba scanner_slide.pdf
Amazon fba scanner_slide.pdfAmazon fba scanner_slide.pdf
Amazon fba scanner_slide.pdf
Barcode Live
 
Slide_How Does Scan And Go Work At Walmart.pdf
Slide_How Does Scan And Go Work At Walmart.pdfSlide_How Does Scan And Go Work At Walmart.pdf
Slide_How Does Scan And Go Work At Walmart.pdf
Barcode Live
 
Slide_Amazon Price Scanner (1).pdf
Slide_Amazon Price Scanner (1).pdfSlide_Amazon Price Scanner (1).pdf
Slide_Amazon Price Scanner (1).pdf
Barcode Live
 
Slide_walmart barcode lookup (1).pdf
Slide_walmart barcode lookup (1).pdfSlide_walmart barcode lookup (1).pdf
Slide_walmart barcode lookup (1).pdf
Barcode Live
 

More from Barcode Live (20)

WeChat QR code scanner
WeChat QR code scanner WeChat QR code scanner
WeChat QR code scanner
 
stock barcoding good or bad (1).pdf
stock barcoding good or bad (1).pdfstock barcoding good or bad (1).pdf
stock barcoding good or bad (1).pdf
 
How to Make a Scannable QR Code
How to Make a Scannable QR CodeHow to Make a Scannable QR Code
How to Make a Scannable QR Code
 
how to create a barcode for a product (1).pdf
how to create a barcode for a product (1).pdfhow to create a barcode for a product (1).pdf
how to create a barcode for a product (1).pdf
 
barcode generator ean-13 (1).pdf
barcode generator ean-13 (1).pdfbarcode generator ean-13 (1).pdf
barcode generator ean-13 (1).pdf
 
free online barcode generator excel (1).pdf
free online barcode generator excel (1).pdffree online barcode generator excel (1).pdf
free online barcode generator excel (1).pdf
 
do qr codes have to be black and white (1).pdf
do qr codes have to be black and white (1).pdfdo qr codes have to be black and white (1).pdf
do qr codes have to be black and white (1).pdf
 
Do QR Codes Expire (1).pdf
Do QR Codes Expire (1).pdfDo QR Codes Expire (1).pdf
Do QR Codes Expire (1).pdf
 
will we run out of QR codes (1).pdf
will we run out of QR codes (1).pdfwill we run out of QR codes (1).pdf
will we run out of QR codes (1).pdf
 
can you change a qr code link (1).pdf
can you change a qr code link (1).pdfcan you change a qr code link (1).pdf
can you change a qr code link (1).pdf
 
what does qr mean in qr codes (1).pdf
what does qr mean in qr codes (1).pdfwhat does qr mean in qr codes (1).pdf
what does qr mean in qr codes (1).pdf
 
what does the ce on products mean (1).pdf
what does the ce on products mean (1).pdfwhat does the ce on products mean (1).pdf
what does the ce on products mean (1).pdf
 
what is the country of origin (1).pdf
what is the country of origin (1).pdfwhat is the country of origin (1).pdf
what is the country of origin (1).pdf
 
barcode country of origin list (1).pdf
barcode country of origin list (1).pdfbarcode country of origin list (1).pdf
barcode country of origin list (1).pdf
 
country of origin certificate (1).pdf
country of origin certificate (1).pdfcountry of origin certificate (1).pdf
country of origin certificate (1).pdf
 
inventory barcode scanners (1).pdf
inventory barcode scanners (1).pdfinventory barcode scanners (1).pdf
inventory barcode scanners (1).pdf
 
Amazon fba scanner_slide.pdf
Amazon fba scanner_slide.pdfAmazon fba scanner_slide.pdf
Amazon fba scanner_slide.pdf
 
Slide_How Does Scan And Go Work At Walmart.pdf
Slide_How Does Scan And Go Work At Walmart.pdfSlide_How Does Scan And Go Work At Walmart.pdf
Slide_How Does Scan And Go Work At Walmart.pdf
 
Slide_Amazon Price Scanner (1).pdf
Slide_Amazon Price Scanner (1).pdfSlide_Amazon Price Scanner (1).pdf
Slide_Amazon Price Scanner (1).pdf
 
Slide_walmart barcode lookup (1).pdf
Slide_walmart barcode lookup (1).pdfSlide_walmart barcode lookup (1).pdf
Slide_walmart barcode lookup (1).pdf
 

Recently uploaded

Resolutions-Key-Interventions-28-May-2024.pdf
Resolutions-Key-Interventions-28-May-2024.pdfResolutions-Key-Interventions-28-May-2024.pdf
Resolutions-Key-Interventions-28-May-2024.pdf
bhavenpr
 
EED - The Container Port PERFORMANCE INDEX 2023
EED - The Container Port PERFORMANCE INDEX 2023EED - The Container Port PERFORMANCE INDEX 2023
EED - The Container Port PERFORMANCE INDEX 2023
El Estrecho Digital
 
Preview of Court Document for Iseyin community
Preview of Court Document for Iseyin communityPreview of Court Document for Iseyin community
Preview of Court Document for Iseyin community
contact193699
 
Gabriel Whitley's Motion Summary Judgment
Gabriel Whitley's Motion Summary JudgmentGabriel Whitley's Motion Summary Judgment
Gabriel Whitley's Motion Summary Judgment
Abdul-Hakim Shabazz
 
2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
2015pmkemenhub163.pdf 2015pmkemenhub163.pdf2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
CIkumparan
 
Letter-from-ECI-to-MeiTY-21st-march-2024.pdf
Letter-from-ECI-to-MeiTY-21st-march-2024.pdfLetter-from-ECI-to-MeiTY-21st-march-2024.pdf
Letter-from-ECI-to-MeiTY-21st-march-2024.pdf
bhavenpr
 
Acolyte Episodes review (TV series)..pdf
Acolyte Episodes review (TV series)..pdfAcolyte Episodes review (TV series)..pdf
Acolyte Episodes review (TV series)..pdf
46adnanshahzad
 
03062024_First India Newspaper Jaipur.pdf
03062024_First India Newspaper Jaipur.pdf03062024_First India Newspaper Jaipur.pdf
03062024_First India Newspaper Jaipur.pdf
FIRST INDIA
 
Hogan Comes Home: an MIA WWII crewman is returned
Hogan Comes Home: an MIA WWII crewman is returnedHogan Comes Home: an MIA WWII crewman is returned
Hogan Comes Home: an MIA WWII crewman is returned
rbakerj2
 
What Ukraine Has Lost During Russia’s Invasion
What Ukraine Has Lost During Russia’s InvasionWhat Ukraine Has Lost During Russia’s Invasion
What Ukraine Has Lost During Russia’s Invasion
LUMINATIVE MEDIA/PROJECT COUNSEL MEDIA GROUP
 
04062024_First India Newspaper Jaipur.pdf
04062024_First India Newspaper Jaipur.pdf04062024_First India Newspaper Jaipur.pdf
04062024_First India Newspaper Jaipur.pdf
FIRST INDIA
 
Hindustan Insider 2nd edition release now
Hindustan Insider 2nd edition release nowHindustan Insider 2nd edition release now
Hindustan Insider 2nd edition release now
hindustaninsider22
 

Recently uploaded (12)

Resolutions-Key-Interventions-28-May-2024.pdf
Resolutions-Key-Interventions-28-May-2024.pdfResolutions-Key-Interventions-28-May-2024.pdf
Resolutions-Key-Interventions-28-May-2024.pdf
 
EED - The Container Port PERFORMANCE INDEX 2023
EED - The Container Port PERFORMANCE INDEX 2023EED - The Container Port PERFORMANCE INDEX 2023
EED - The Container Port PERFORMANCE INDEX 2023
 
Preview of Court Document for Iseyin community
Preview of Court Document for Iseyin communityPreview of Court Document for Iseyin community
Preview of Court Document for Iseyin community
 
Gabriel Whitley's Motion Summary Judgment
Gabriel Whitley's Motion Summary JudgmentGabriel Whitley's Motion Summary Judgment
Gabriel Whitley's Motion Summary Judgment
 
2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
2015pmkemenhub163.pdf 2015pmkemenhub163.pdf2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
2015pmkemenhub163.pdf 2015pmkemenhub163.pdf
 
Letter-from-ECI-to-MeiTY-21st-march-2024.pdf
Letter-from-ECI-to-MeiTY-21st-march-2024.pdfLetter-from-ECI-to-MeiTY-21st-march-2024.pdf
Letter-from-ECI-to-MeiTY-21st-march-2024.pdf
 
Acolyte Episodes review (TV series)..pdf
Acolyte Episodes review (TV series)..pdfAcolyte Episodes review (TV series)..pdf
Acolyte Episodes review (TV series)..pdf
 
03062024_First India Newspaper Jaipur.pdf
03062024_First India Newspaper Jaipur.pdf03062024_First India Newspaper Jaipur.pdf
03062024_First India Newspaper Jaipur.pdf
 
Hogan Comes Home: an MIA WWII crewman is returned
Hogan Comes Home: an MIA WWII crewman is returnedHogan Comes Home: an MIA WWII crewman is returned
Hogan Comes Home: an MIA WWII crewman is returned
 
What Ukraine Has Lost During Russia’s Invasion
What Ukraine Has Lost During Russia’s InvasionWhat Ukraine Has Lost During Russia’s Invasion
What Ukraine Has Lost During Russia’s Invasion
 
04062024_First India Newspaper Jaipur.pdf
04062024_First India Newspaper Jaipur.pdf04062024_First India Newspaper Jaipur.pdf
04062024_First India Newspaper Jaipur.pdf
 
Hindustan Insider 2nd edition release now
Hindustan Insider 2nd edition release nowHindustan Insider 2nd edition release now
Hindustan Insider 2nd edition release now
 

Slide_code 128 barcode font for excel (1).pdf

  • 2. table of content 1 2 What Is Code 128 Barcode Font? How to Generate Code 128 Barcode Font for Excel?
  • 3. 1 Code 128 Barcode Font is a type of barcode font that allows users to create code 128 barcodes in Excel WHAT IS CODE 128 BARCODE FONT? barcodelive.org
  • 4. A high-density linear barcode that can hold large amounts of data in a compact format Easy to install & use and can be integrated into a wide range of applications Code128 Code128font
  • 5. CODE 128 THREE SUBSETS Code 128A: for alphanumeric data (uppercase letters, numbers & control characters) Code 128B: for full ASCII data (uppercase and lowercase letters, numbers & symbols) Code 128C: for numeric-only data
  • 6. barcodelive 2 How to Generate Code 128 Barcode Font for Excel?
  • 7. Download Code 128 Font and extract the downloaded folder into the C:WindowsFonts folder Turn on the Excel's Developer module Step1 Step2
  • 8. Barcode Barcode String Barcode Presentation Check X X X X Step3 Make a new Excel sheet in Microsoft with the following titles & structure
  • 9. Choose Visual Basic from the Developer tab on the ribbon to launch the Visual Basic window Step4 Step5 Right-click & choose "Insert Module." Then, paste a code
  • 10. Option Explicit Public Function Code128(SourceString As String) 'Written by Philip Treacy, Feb 2014 'http://www.myonlinetraininghub.com/create-barcodes-with-excel-vba 'This code is not guaranteed to be error free. No warranty is implied or expressed. Use at your own risk and carry out your own testing 'This function is governed by the GNU Lesser General Public License (GNU LGPL) Ver 3'Input Parameters : A string 'Return : 1. An encoded string which produces a bar code when dispayed using the CODE128.TTF font ' 2. An empty string if the input parameter contains invalid characters Dim Counter As Integer Dim CheckSum As Long Dim mini As Integer Dim dummy As Integer Dim UseTableB As Boolean Dim Code128_Barcode As String If Len(SourceString) > 0 Then 'Check for valid charactersFor Counter = 1 To Len(SourceString) Select Case Asc(Mid(SourceString, Counter, 1)) Case 32 To 126, 203Case Else MsgBox "Invalid character in barcode string." & vbCrLf & vbCrLf & "Please only use standard ASCII characters", vbCritical Code128 = ""Exit FunctionEnd SelectNext Code128_Barcode = "" UseTableB = True Counter = 1Do While Counter <= Len(SourceString) If UseTableB Then'Check if we can switch to Table C
  • 11. mini = IIf(Counter = 1 Or Counter + 3 = Len(SourceString), 4, 6) GoSub testnum If mini% < 0 Then 'Use Table C If Counter = 1 Then Code128_Barcode = Chr(205) Else 'Switch to table C Code128_Barcode = Code128_Barcode & Chr(199) End If UseTableB = False Else If Counter = 1 Then Code128_Barcode = Chr(204) 'Starting with table B End IfEnd IfIf Not UseTableB Then'We are using Table C, try to process 2 digits mini% = 2 GoSub testnum If mini% < 0 Then 'OK for 2 digits, process it dummy% = Val(Mid(SourceString, Counter, 2)) dummy% = IIf(dummy% < 95, dummy% + 32, dummy% + 100) Code128_Barcode = Code128_Barcode & Chr(dummy%) Counter = Counter + 2Else 'We haven't got 2 digits, switch to Table B Code128_Barcode = Code128_Barcode & Chr(200) UseTableB = TrueEnd IfEnd IfIf UseTableB Then'Process 1 digit with table B Code128_Barcode = Code128_Barcode & Mid(SourceString, Counter, 1) Counter = Counter + 1 End If
  • 12. Loop 'Calculation of the checksumFor Counter = 1 To Len(Code128_Barcode) dummy% = Asc(Mid(Code128_Barcode, Counter, 1)) dummy% = IIf(dummy% < 127, dummy% - 32, dummy% - 100) If Counter = 1 Then CheckSum& = dummy% CheckSum& = (CheckSum& + (Counter - 1) * dummy%) Mod 103Next'Calculation of the checksum ASCII code CheckSum& = IIf(CheckSum& < 95, CheckSum& + 32, CheckSum& + 100) 'Add the checksum and the STOP Code128_Barcode = Code128_Barcode & Chr(CheckSum&) & Chr$(206) End If Code128 = Code128_Barcode Exit Function testnum: 'if the mini% characters from Counter are numeric, then mini%=0 mini% = mini% - 1 If Counter + mini% <= Len(SourceString) Then Do While mini% >= 0 If Asc(Mid(SourceString, Counter + mini%, 1)) < 48 Or Asc(Mid(SourceString, Counter + mini%, 1)) > 57 Then Exit Do mini% = mini% - 1 Loop End If Return End Function
  • 13. Step6 Insert =Code128([@Barcode]) into cell B2 ("Barcode String"). Insert =[@[Barcode String]] into cell C2 ("Barcode Presentation"). Insert the following code in cell D2 ("Check"): =IF(ISNUMBER(SEARCH("Â",[@[Barcode Presentation]],1)),"Error!","") Reopen your Excel document and add the following formulas:
  • 14. Step7 Highlight Column C & change the font to “Code 128”. Now when you enter data into cell A2, a barcode should be displayed in cell C2 and so-on down the entire sheet.