RE:Validar Targeta de Credito !!!!!Urgente!!!
Te envio una función para validar una tarjeta de crédito. De todas maneras te envié un correo por si acaso no te llega bien.
Public Function IsValidCreditCardNumber(ByVal sCardNo _
As String) As Boolean
´Must get rid of "-" and " " characters before calling this
´function
´alternatively, add Replace(sCardNo, "-", "") and
´Replace (sCardNo, " ", "")
´to the beginning of the function
Const MAX_DIGITS = 20 ´ actually don´t know any
´card using more than 16 digits
Dim anDigits(1 To MAX_DIGITS) As Byte
Dim nDigits As Long
Dim ofsCurrentDigit As Long
Dim ofsCurrentCharacter As Long
Dim CurrentCharacter As String
Dim Multiplier As Long
Dim CheckSum As Long
Dim DigitValue As Long
Dim Result As Boolean
Dim ValidDigits As String
If Not IsNumeric(sCardNo) Then Exit Function
If Len(Trim$(sCardNo)) < 1 Then
Result = False
GoTo Exit_Point
End If
ValidDigits = "0123456789"
For ofsCurrentCharacter = 1 To Len(sCardNo)
CurrentCharacter = Mid$(sCardNo, ofsCurrentCharacter, 1)
If InStr(1, ValidDigits, CurrentCharacter, _
vbBinaryCompare) Then
nDigits = nDigits + 1
If nDigits > MAX_DIGITS Then
Result = False
GoTo Exit_Point
End If
anDigits(nDigits) = Val