You have to apply in person at a Spanish consulate in UK and take the following documents with you:
Original passport
A stamped (also at the consulate) photocopy of your passport
The fee of £22.
2 recent passport size photos. The background must be plain, and people who wear glasses and/or earrings must take them off for the photo
An original copy + photocopy of a document which explains why you need your NIE. This can be the private sales contract you have signed
A NIE application form. This is not provided by the consulate and you will have to download it from the Spanish Interior Ministry website. Do not sign the application form as this has to be done in front of a consulate official who stamps it as valid.
A self-addressed envelope
An envelope big enough to contain all the above + NIE application form addressed to the central police HQ in Madrid: Comisaría General de Extranjería y Documentación, Dirección General de Policia, C/ General Pardiñas, 90, 28006 Madrid, Spain
Once the NIE application form with your signature and passport have been stamped, the consulate will send the envelope containing all the above to Madrid. Then you will have to wait to receive your NIE.
Depending where you live, you apply(in person) at one of the following:
Northern Ireland, Cheshire, Cleveland, Clwyd, Cumbria, Derbyshire, Durham, Manchester, Gwynedd, Humberside, Lancashire, Lincolnshire, the Isle of Man, Merseyside, Northumberland, Nottinghamshire, Shropshire, Staffordshire, Tyne & Wear or Yorkshire, please apply to: The Spanish Consulate General, 1 Brooks House, 70 Spring Gardens, Manchester, M2 2BQ. Tel: 0161 236 1233
Scotland or the Scottish Islands, please apply to: The Spanish Consulate General, 63 North Castle Street, Edinburgh, EH2 3LJ. Tel: 0131 220 1843
And if you live anywhere else within the UK apply to the London office: 20 Draycott Place, London SW3 2RZ, Tel: 020 7589 8989, Fax: 020 7581 7888
It could take around a month to have the NIE number posted to you.
Phew! Maybe something that is easier done whilst in Spain.