Modulo 43 spreadsheet

N

NickHK

Not sure what you mean by a "a Modulo 43 spreadsheet", but this function
calculates the check digit according to the Modulo 43 applied to the CODE 39
encoding logic.
You should add checks for valid input.

Public Function GetModulo43(CodeText As String) As String
Dim CharValues() As String
Dim i As Long
Dim RunSum As Long

Const Chars As String =
"0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,-,.
, ,$,/,+,%"

CharValues = Split(Chars, ",")

For i = 1 To Len(CodeText)
RunSum = RunSum + Application.WorksheetFunction.Match(Mid(CodeText, i,
1), CharValues, 0) - 1
Next

GetModulo43 = CharValues(RunSum Mod 43)

End Function

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Help: Modulo... not... quite...right... 3
Xth Weekday of the Month/Year 2
modulo 3
Outlook 2003 crashed. Failure at mso.dll 1
form word 2003 2
Video Time Format 4
word 2003 7
APPCRASH with explorer.exe 0

Top