S
Safi
I have written a code in excel to convert data into Bar Code 128 B. The code
is as follows:
Function Format_Code128(InString As String) As String
Dim Sum As Integer, i As Integer
Dim Checksum As Integer, Checkchar As Integer
Dim MyString As String, CVal As Integer
Sum = 104
For i = 1 To Len(InString)
MyString = Mid$(InString, i, 1)
CVal = Asc(MyString) - 32
Sum = Sum + (CVal * i)
Next i
Checksum = Sum Mod 103
If Checkdigit = 0 Then
Checkchar = 174
ElseIf Checkdigit < 94 Then
Checkchar = Checkdigit + 32
Else
Checkchar = Checkdigit + 71
End If
MyString = Chr(162) + InString + Chr(Checkchar) + Chr(164)
Format_Code128 = MyString
End Function
When I run this User defined Funtion I got ¢Variant-B®¤ instead of
Å¡Variant-BJÅ“
Does you correct me where I went wrong.
Regards,
safi
is as follows:
Function Format_Code128(InString As String) As String
Dim Sum As Integer, i As Integer
Dim Checksum As Integer, Checkchar As Integer
Dim MyString As String, CVal As Integer
Sum = 104
For i = 1 To Len(InString)
MyString = Mid$(InString, i, 1)
CVal = Asc(MyString) - 32
Sum = Sum + (CVal * i)
Next i
Checksum = Sum Mod 103
If Checkdigit = 0 Then
Checkchar = 174
ElseIf Checkdigit < 94 Then
Checkchar = Checkdigit + 32
Else
Checkchar = Checkdigit + 71
End If
MyString = Chr(162) + InString + Chr(Checkchar) + Chr(164)
Format_Code128 = MyString
End Function
When I run this User defined Funtion I got ¢Variant-B®¤ instead of
Å¡Variant-BJÅ“
Does you correct me where I went wrong.
Regards,
safi