ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   If Statements (https://www.excelbanter.com/excel-programming/289456-if-statements.html)

Mike Wilson

If Statements
 
Is it possible to automate the checking of a Postcode column to determine
whether or not the entry is valid : ie not blank, does not contain hypens
and is greater than 4 characters.
If tried using the built in help functions for Excel 2000 but just end up
with gibberish.

Thanks in anticipation


Mike

Henry[_5_]

If Statements
 
Mike,

Which country's postcodes are you talking about?

UK postcodes are complicated as the first 4 characters (the outward code)
can be
1st char 2nd char 3rd char 4th char
letter letter number number eg.
TW21
letter number number nothing eg.
L22
letter number nothing nothing eg.
E9
letter letter number letter
eg. EC1V

There is always a space followed by 1 number (0-9) and two letters for the
second (inward) part of the code.

e.g.
E9 2ZZ
TW21 5SS
L22 4QQ
EC1V 1LE

The way I check that the postcode is valid in my program is to first check
that the user has entered the last four characters as
space,number,letter,letter.
If this is OK, I then use a lookup list to check that the outward code is in
our area.
If this is what you want then repost here and I'll forward the code.

If you want to do this for the whole of the UK, I suggest that you contact
the Post Office postcode helpline for an up-to-date list. There are
thousands of outward codes and the list changes frequently. This is due to
PostTown boundary changes and temporary codes such as BS99 (a code used for
mass mailings, catalogues, etc.) being added and removed.

HTH
Henry





"Mike Wilson" wrote in message
. uk...
Is it possible to automate the checking of a Postcode column to determine
whether or not the entry is valid : ie not blank, does not contain hypens
and is greater than 4 characters.
If tried using the built in help functions for Excel 2000 but just end up
with gibberish.

Thanks in anticipation


Mike





All times are GMT +1. The time now is 07:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com