LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default UDF for Data into 128 B barcode problem

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

' Initialize running total with value of
' Subset B start character

Sum = 104

' Scan the string and add character value times position

For i = 1 To Len(InString)

' Copy one character from InString position i to MyString

MyString = Mid$(InString, i, 1)

' Get the numeric value of the character and subtract
' 32 to shift (the space character, ASCII value 32, has
' a numeric value of 0 as far as Code 128 is concerned)

CVal = Asc(MyString) - 32

' Add the weighted value into the running sum

Sum = Sum + (CVal * i)
Next i

' Calculate the Modulo 103 checksum

Checksum = Sum Mod 103

' Now convert this number to a character.

If Checkdigit = 0 Then
Checkchar = 174
ElseIf Checkdigit < 94 Then
Checkchar = Checkdigit + 32
Else
Checkchar = Checkdigit + 71
End If

' Now format the final output string: start character,
' data, check character, and stop character

MyString = Chr(162) + InString + Chr(Checkchar) + Chr(164)
Format_Code128 = MyString
End Function

Hi,

I have code above User Define funtion in Excel and converted my data
(example CCF001257) into code 128 B of Barcode symbology..the UDF returns
value as
¢CCF001257®¤ but when in change it into code 128 font with 20 font size the
scanner does not reads it.. where is the problem lies ...

Regards,

safi.


 
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
does excel support barcode scanning? Jase Excel Discussion (Misc queries) 8 December 7th 05 10:50 AM
Problem With Reference Update Egon Excel Worksheet Functions 17 July 16th 05 05:45 AM
Copy an Drag cell Formula Problem Nat Excel Discussion (Misc queries) 1 June 20th 05 03:24 PM
Freeze Pane problem in shared workbooks JM Excel Discussion (Misc queries) 1 February 1st 05 12:04 AM
Spreadsheet with readable barcode data when printed. BarDoomed Excel Worksheet Functions 6 January 7th 05 08:11 PM


All times are GMT +1. The time now is 04:50 PM.

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

About Us

"It's about Microsoft Excel"