Hello Forum,
I am having an issue with UK Postcode copying.
The issue is: I have address column and postcode column. Now, I am supposed find the postcode from address cell and copy it to its corresponding postcode column. The postcode, can be found in following way:
a) Opening brace for Postcode in Address is missing
b) Closing brace for Postcode in Address is missing
c) Both a and b,
d) Postcode is completely missing in Address, then no issue
e) More than one Post code exist in Address, then copy first postcode
I am able to copy the postcode from address to postcode column, if it is with in braces. But for all the other conditions, I fail. Please help me. Below here you can find different types of data with above mentioned conditions, where I am failing to copy the postcode from address to postcode column:
Address |
Postcode |
25 Odette Duval House, Stepney Way, London, IE1 3HJ) |
IE1 3HJ |
11 Peel Street, Denton, Manchester (M34 3JY |
M34 3JY |
8 Leeward Court, Quay 430, Kennet Street, Wapping B15 3JF and parking space 185 |
B15 3JF |
Flat 42, Canal Wharf 305, Kingsland Road, London
2 Boscobel Road, Great Lever, Bolton, (BL3 2LN) and 184 Green Lane, Great Lever, Bolton, (BL3 2LF) |
BL3 2LN |
Please go through the vba for this purpose I am using:
I have valid post code formats of UK.
FORMAT |
EXAMPLE |
AN NAA |
M1 1AA |
ANN NAA |
M60 1NW |
AAN NAA |
CR2 6XH |
AANN NAA |
DN55 1PT |
ANA NAA |
W1A 1HQ |
AANA NAA |
EC1A 1BB |
Please note the following:
- The letters Q, V and X are not used in the first position
- The letters I,J and Z are not used in the second position.
- The only letters to appear in the third position are A, B, C, D, E, F, G, H, J, K, S, T, U and W.
- The second half of the postcode is always consistent numeric, alpha, alpha format and the letters C, I, K, M, O and
V are never used.
Postcodes should always be in BLOCK CAPITALS. Leave a clear space of one character between the two parts of the postcode and do not join the
characters in any way.
Bookmarks