Knowledge Share

Knowledge is NOT Power IMPLEMENTATION of knowledge is Power!!!
 
HomePortalGalleryCalendarFAQRegisterUsergroupsLog in

Share | 
 

 Validating PAN number

View previous topic View next topic Go down 
AuthorMessage
Admin
Admin


Posts : 142
Points : 410
Reputation : 0
Join date : 2007-12-29
Location : Chennai

PostSubject: Validating PAN number   Wed Jun 10, 2015 11:42 am

Function ValidatePAN(panentry As String) As Boolean

'ValidatePAN = True

'pan = Range("PAN").Value

If Len(panentry) > 0 Then

If Not IsNumeric(Mid(panentry, 6, 4)) Then

    ValidatePAN = False

    Exit Function

End If

If Not CheckAtoZ(Mid(panentry, 1, 1)) Then

ValidatePAN = False

Exit Function

End If

If Not CheckAtoZ(Mid(panentry, 2, 1)) Then

ValidatePAN = False

Exit Function

End If

If Not CheckAtoZ(Mid(panentry, 3, 1)) Then

ValidatePAN = False

Exit Function

End If

If Not CheckAtoZ(Mid(panentry, 4, 1)) Then

ValidatePAN = False

Exit Function

End If

If Not CheckAtoZ(Mid(panentry, 5, 1)) Then

ValidatePAN = False

Exit Function

End If

If Not CheckAtoZ(Mid(panentry, 10, 1)) Then

ValidatePAN = False

Exit Function

End If

End If


End Function



To check the letters in PAN falls in A-Z



Function CheckAtoZ(chr1) As Boolean

CheckAtoZ = True

If ((Asc(chr1) < 65) Or (Asc(chr1) > 90)) Then

CheckAtoZ = False

End If

End Function
Back to top Go down
http://knowledgeshare.forumotion.com
 
Validating PAN number
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» is it possible to find number of elements in an selectd xpath by selenium rc..?
» wrong number of arguments provided in nunit
» how to store number of rows of a table
» Retrieving number of rows in a table
» Number of Migraines per month on average

Permissions in this forum:You cannot reply to topics in this forum
Knowledge Share :: Testing :: Automation :: VSTS :: CODED UI-
Jump to: