VBA/Barcode 128

mjspiz

New Member
Joined
Apr 5, 2016
Messages
11
Hello,
I am trying to generate a code128 barcode(s) with VBA, but having some difficulty. The barcode should be generated in column B next to the SID number. Here is the code I have so far. Any idea what I need to do to make this work?
Thank you.

VBA Code:
Dim ReadData As String

    Open fName For Input As #1

    Do Until EOF(1)
    
       Line Input #1, ReadData
      
       Trimmed_Line = Trim(ReadData)
    
        counter1 = counter1 + 1
        UnitLine() = Split(ReadData, ",")
        SID = UnitLine(5)
        BCode = UnitLine(0)
              
        Dim myWorksheet As Worksheet, sh As Worksheet

       Set myWorksheet = ActiveSheet
       ActiveSheet.Name = "Lyric"
       Row_Number = Row_Number + 1
    
       Cells(Row_Number, 1).Value = SID
       Cells(Row_Number, 2).Value = code128(SID) ???
                
          
    Loop
    
    Close #1
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
What is the difficulty? To be able to display the barcode, you need to install the code128 barcode and to format the cell you want to display code.
 
Upvote 0
Solution
What is the difficulty? To be able to display the barcode, you need to install the code128 barcode and to format the cell you want to display code.
Yah, I figured it out. Installed the code128 font. From there, the coding was easy.
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,024
Members
449,092
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top