Validation of UK Postcodes all formats

Status
Not open for further replies.

Engineerlee

New Member
Joined
Nov 30, 2012
Messages
26
Hi
I am looking to validate UK postcodes in a similar fashion to another thread on here but it is quite old so thought I would generate a new one. Hopefully this isnt against the rules


Can some one help
I am looking to do the same sort of validation including the CIKMOV check and illegal characters but with more postcode formats


My postcode field that is always 9 characters in length
There are no spaces between the segments of the postcode

Where a Postcode isnt the full 9 characters it is padded with spaces - these need to be also validated

AN[Space][Space][Space][Space][Space][Space][Space]
ANN[Space][Space][Space][Space][Space][Space]
AANA[Space][Space][Space][Space][Space]
ANNAA[Space][Space][Space][Space]
ANNNAA[Space][Space][Space]
AANNAA[Space][Space][Space]
ANANAA[Space][Space][Space]
AANANAA[Space][Space]
AANNNAA[Space][Space]
ANNAANA[Space][Space]
ANNNAANA[Space]
AANNAANA[Space]
ANANAANA[Space]
AANANAANA
AANNNAANA

Where A is alphabet character and N is number. [Space] is a physical space and not a word
If the condition is incorrect then highlight that particular cell that contains the incorrect postcode.
Many thanks in advance.
In reality they would look something like this

S1
S11
EC1A
S12BB
S112BB
LS12BB
W1A1BB
EC1A2BB
LS112BB
S12BB9Z
S112BB9Z
LS12BB9Z
W1A1BB9Z
EC1A2BB9Z
LS112BB9Z


Many thanks in advance
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Status
Not open for further replies.

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top