Thread: Error trapping
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] craigoutinoz@hotmail.com is offline
external usenet poster
 
Posts: 4
Default Error trapping

Hi,

I have the below coding, it all works however I need to be able to put
a variable figure on the range B17. i.e. some cards have 16 digits,
some have 19. So I need to instruct the sheet to return a message when
there less or more numbers than this??

Can anyone help?

Thanks in advance.

Cragcito



Public Sub Pre_Checks_Before_Mail()

If Range("B13").Value = "" Then
MsgBox "You have not entered The Account Number."
Exit Sub
End If


If Range("B14").Value = "" Then
MsgBox "You have not entered The Customer Number."
Exit Sub
End If

If Range("B16").Value = "" Then
MsgBox "You have not entered Card Security Number."
Exit Sub
End If

If Range("B17").Value = "" Then
MsgBox "Please enter Exact Name on Card."
Exit Sub
End If

''If Range("B17").Value <= "****************" Then
'' MsgBox "Card Number must be at least 16 digits."
'' Exit Sub
''End If

If Range("B19").Value = Range("E15").Value Then
MsgBox "Card is to NEW"
Exit Sub
End If

If Range("B20").Value = 0 Then
MsgBox "Expiry date is needed"
Exit Sub
End If

If Range("B20").Value <= Range("E15").Value Then
MsgBox "Card has EXPIRED"
Exit Sub
End If

If Range("B18").Value < 0 Then
MsgBox "We can process a card payment without a card
number?!?!?!?!."
Exit Sub
End If

If Range("B22").Value = 0 Then
MsgBox "We MUST have a phone number to contact customer"
Exit Sub
End If

If Range("B23").Value = "" Then
MsgBox "Card BILLING address is required"
Exit Sub
End If

If Range("B8").Value 0 Then
MsgBox "Is customer aware of 2% surcharge??"
Exit Sub
End If

'' If Range("B17").Value <= "???????????????" Then
'' MsgBox "Card Number must be at least 16 digits."
'' Exit Sub
''End If