Wie kann man die Pruefziffer eines EAN13 in Excel berechnen?

  • Anonymous
  • Topic Author
  • Offline
  • New Member
  • New Member
More
13 years 5 months ago - 13 years 5 months ago #1025 by Anonymous
Über ein Makro "GetEAN" mit folgendem Inhalt:

Function GetEAN(cWert As String) As Integer

Dim x As Integer, nSumme As Integer, nLang As Integer
Dim lGerade As Boolean

nLang = Len(cWert)
lGerade = True
For x = 1 To nLang
lGerade = Not lGerade
If lGerade Then
nSumme = nSumme + Val(Mid$(cWert, x, 1)) * 3
Else
nSumme = nSumme + Val(Mid$(cWert, x, 1)) * 1
End If
Next x
GetEAN = Int((nSumme + 9) / 10) * 10 - nSumme

End Function

Please Log in or Create an account to join the conversation.

Signum GmbH
Kasinostraße 2
DE-64293 Darmstadt, Germany

Tel: +49 (6151) 15 18 - 0
Fax: +49 (6151) 15 18 - 100
team@signum.info