VB script not running

P Pete Wedd 1 year 3 months ago
62 1 0

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

Image removed.

Can anybody advise please?

 

Please Register or Login to post a reply

1 Replies

C Chris Bryant

same problem here

CONTACT
Can’t find what you’re looking for?