Postcodes
I've just thought of something after I sent the reply, by using the formula
you sent me I always get the first part of the code as it finds the space.
So there are only two combination of the first part letter letter number
number or letter number number. So if you use a LEN to count the characters
if it equals 4 the LEFT function should be two if it equals 3 the LEFT
function should be 1. Right?
Again, thanks.
SPL
wrote in message
oups.com...
The other problem which you haven't mentioned is that the numeric part
could be more than one character long (EG SG15 2ST)
with a postcode in A1, this formula gets to the first part of the code
=LEFT(A1,SEARCH(" ",A1)-1)
however, it doesn't resolve it - SO would suggest using a user defined
function as follows
Function pcodereturn(Postcode As String)
While Left(Postcode, 1) < " " And (Asc(Left(Postcode, 1)) < 48 Or
Asc(Left(Postcode, 1)) 57)
pcodereturn = pcodereturn & Left(Postcode, 1)
Postcode = Right(Postcode, Len(Postcode) - 1)
Wend
End Function
|