Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code Correction Need
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Value correction | Excel Discussion (Misc queries) | |||
Correction of Function | Excel Worksheet Functions | |||
correction | Excel Discussion (Misc queries) | |||
Data correction | Excel Programming | |||
formula correction | Excel Worksheet Functions |