please help how can i acomplish this?

shaggy71875

New Member
Joined
Nov 5, 2005
Messages
6
hello all im new to excell and vba im trying to take numbers 10 digits in lenth and change them into 2 of 5 interleved barcode in excell

http://grandzebu.net/informatique/codbar-en/code25I.htm

ive tried his program and it works great on stand alone. dont know how to incorperate it into excell i have a column with the numbers (f) and column (g) formated with his Code 2 of 5 interleaved txt font .

problem is just typeingin the numbers doesnt give the correct barcode.
it has to be changed to his ascii format and É and Ê put as the begining and end chars.

example ÉQMQ8SÊ is = to 4844482350

any help would be appericated.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
the web page states

Since 2 of 5 interleaved barcodes encode pairs of digit my font contain the 100 pairs from 00 to 99. 2 additionnal characters are reserved for start and end symbol.

Pair of digits
ASCII Code
Character
Pattern

00
0033
!
NNNNWWWWNN

01
0034
"
NWNNWNWNNW

.../...

93
0126
~
NWWWNNWNNN

94
0195
Ã
NNWNNWWNNW

.../...

99
0200
È
NNWNNNWWNW

Start
0201
É
NNNN

Stop
0202
Ê
WNN
 
Upvote 0
vba code given to try to impliment

Public Function Code25I$(chaine$)


'V 1.0.0
'Parameters : a string
'Return : * a string which give the bar code when it is dispayed with CODE25I.TTF font
' * an empty string if the supplied parameter is no good
Dim i%, checksum&, dummy%
Code25I$ = ""
If Len(chaine$) > 0 Then
'Check for valid characters
For i% = 1 To Len(chaine$)
If Asc(Mid$(chaine$, i%, 1)) < 48 Or Asc(Mid$(chaine$, i%, 1)) > 57 Then Exit Function
Next
'Add if necessary the checksum
If COkey = vbChecked Then
For i% = Len(chaine$) To 1 Step -2
checksum& = checksum& + Val(Mid$(chaine$, i%, 1))
Next
checksum& = checksum& * 3
For i% = Len(chaine$) - 1 To 1 Step -2
checksum& = checksum& + Val(Mid$(chaine$, i%, 1))
Next
chaine$ = chaine$ & (10 - checksum& Mod 10) Mod 10
End If
'Check if the length is odd
If Len(chaine$) \ 2 <> Len(chaine$) / 2 Then Exit Function
'Calculation of the code string
For i% = 1 To Len(chaine$) Step 2
dummy% = Val(Mid$(chaine$, i%, 2))
dummy% = IIf(dummy% < 94, dummy% + 33, dummy% + 101)
Code25I$ = Code25I$ & Chr$(dummy%)
Next
'Add START and STOP
Code25I$ = Chr$(201) & Code25I$ & Chr$(202)
End If
End Function

is some of this french ?
and what excatly do these lines do
any pointers to a good vb site will help
 
Upvote 0
still working on this any suggestions would be helpfull

i think all i need to do is change the string of numbers to ascii then add on the first and last char and it will display right.
 
Upvote 0

Forum statistics

Threads
1,224,891
Messages
6,181,614
Members
453,057
Latest member
LE102024

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