zargus
Joined: 12 Feb 2007 Posts: 1
|
Posted: Mon Feb 12, 2007 11:26 am Post subject: Can anyone help me to check this function? |
|
|
Actually I am trying to create a function that can identify a postcode from a 'string' of address. The function should be able to verify the 5 digits (the postcode) which are located next to each other. The function that I have cannot function properly. Here is the function:
========================================
Function getpostcode (value)
dim leng As Integer
dim pc As String
For
leng=1 To len (value)
pc=mid(value,leng,1)
End if
If Is Numeric (pc) Then
pc=mid(value, leng,2)
End If
...........................
If Is Numeric (pc) =5 Then
getpostcode=pc
leng=Len (value) + 1
End If
Next leng
End Function
=========================================
I really hope there's someone out there can help me to correct the function. Thanks for your attention  |
|