We copied an Excel function written on a pc to Excel on the Mac.
The function turns the arg value into a Code128 barcode font.
The converted value has some odd characters (leading and trailing)
the barcode. I think the characters are wrong because the added
characters are pc specific characters.
Does anyone know the proper characters to add to the code 128 font
which would replace these pc specific characters.
Bret Stern
bc128C = fontString & Chr(194) & Chr(196)
Case 1 To 93
bc128C = fontString & Chr(checkDigitSubtotal + 32) & Chr(196)
Case Is > 93
bc128C = fontString & Chr(checkDigitSubtotal + 103) & Chr(196)
Function bc128C(ByVal yourData As String) As String
Dim fontString As String
Dim temp As String
Dim checkDigitSubtotal As Integer
Dim chunk As String
Dim i As Integer
fontString = Chr(183)
checkDigitSubtotal = 105
temp = yourData
For i = 1 To Len(yourData) / 2
chunk = Left$(temp, 2)
checkDigitSubtotal = checkDigitSubtotal + Val(chunk) * i
Select Case Val(chunk)
Case 0
fontString = fontString + Chr(206)
Case 1 To 93
fontString = fontString & Chr(Val(chunk) + 32)
Case Is > 93
fontString = fontString & Chr(Val(chunk) + 103)
End Select
temp = Right$(temp, Len(temp) - 2)
Next i
checkDigitSubtotal = checkDigitSubtotal Mod 103
Select Case checkDigitSubtotal
Case 0
bc128C = fontString & Chr(194) & Chr(196)
Case 1 To 93
bc128C = fontString & Chr(checkDigitSubtotal + 32) & Chr(196)
Case Is > 93
bc128C = fontString & Chr(checkDigitSubtotal + 103) & Chr(196)
End Select
End Function
The function turns the arg value into a Code128 barcode font.
The converted value has some odd characters (leading and trailing)
the barcode. I think the characters are wrong because the added
characters are pc specific characters.
Does anyone know the proper characters to add to the code 128 font
which would replace these pc specific characters.
Bret Stern
bc128C = fontString & Chr(194) & Chr(196)
Case 1 To 93
bc128C = fontString & Chr(checkDigitSubtotal + 32) & Chr(196)
Case Is > 93
bc128C = fontString & Chr(checkDigitSubtotal + 103) & Chr(196)
Function bc128C(ByVal yourData As String) As String
Dim fontString As String
Dim temp As String
Dim checkDigitSubtotal As Integer
Dim chunk As String
Dim i As Integer
fontString = Chr(183)
checkDigitSubtotal = 105
temp = yourData
For i = 1 To Len(yourData) / 2
chunk = Left$(temp, 2)
checkDigitSubtotal = checkDigitSubtotal + Val(chunk) * i
Select Case Val(chunk)
Case 0
fontString = fontString + Chr(206)
Case 1 To 93
fontString = fontString & Chr(Val(chunk) + 32)
Case Is > 93
fontString = fontString & Chr(Val(chunk) + 103)
End Select
temp = Right$(temp, Len(temp) - 2)
Next i
checkDigitSubtotal = checkDigitSubtotal Mod 103
Select Case checkDigitSubtotal
Case 0
bc128C = fontString & Chr(194) & Chr(196)
Case 1 To 93
bc128C = fontString & Chr(checkDigitSubtotal + 32) & Chr(196)
Case Is > 93
bc128C = fontString & Chr(checkDigitSubtotal + 103) & Chr(196)
End Select
End Function