Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Value correction P. Zicari Excel Discussion (Misc queries) 2 April 15th 08 07:28 PM
Correction of Function SG Excel Worksheet Functions 1 August 7th 07 06:54 AM
correction nowfal Excel Discussion (Misc queries) 4 March 24th 06 06:40 PM
Data correction [email protected] Excel Programming 2 July 12th 05 02:15 PM
formula correction Roccobarocco Excel Worksheet Functions 4 December 6th 04 01:39 AM


All times are GMT +1. The time now is 01:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"