Trying to run a script VB script which has been validated via Excel
The script is
Public Function CheckLetter(Specimen_Number)
Dim xCounter As Integer
Dim checkSum As Long
Do While Specimen_Number <> ""
CheckLetter = CheckLetter & Asc(Left(Specimen_Number, 1))
Specimen_Number = Mid(Specimen_Number, 2, 10)
Loop
For xCounter = 1 To 16
checkSum = checkSum + ((23 - xCounter) * Asc(Mid(CheckLetter, xCounter, 1)))
Next xCounter
checkSum = checkSum - Int((checkSum / 23)) * 23
CheckLetter = Mid("BWDFGKQVYXASTNJHRPLCZME", 23 - checkSum, 1)
End Function
Can anybody advise please?
1 Replies
same problem here