ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Modulo 43 spreadsheet (https://www.excelbanter.com/excel-programming/391129-modulo-43-spreadsheet.html)

RSB

Modulo 43 spreadsheet
 
How do I create a Modulo 43 spreadsheet in Excel 2003

NickHK

Modulo 43 spreadsheet
 
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

"RSB" wrote in message
...
How do I create a Modulo 43 spreadsheet in Excel 2003





All times are GMT +1. The time now is 11:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com