Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Postcode problem better explained

Hi - I have explained this a bit better now -

If I have a cell and the contents are like this
here are 3 examples -

GREENGATES S.P, APPERLEY RD, GREENGATES, BRADFORD, BD10
0PU

SILSDEN, CRINGLES, SILSDEN, KEIGHLEY, BD20

MIDDLESMOOR SERVICE RES, MIDDLESMOOR SERVICE RES,
HARROGATE, NORTH YORKSHIRE, , HG3

How can I get the postcodes out of those cells? for now I
just want them to go into the same row in the end column.

any tutorials or similar or pages with similar stuff on
would be great. Thanks

Mary
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Postcode problem better explained

Try it with this:

MsgBox Trim(Mid(Cells(1), InStrRev(Cells(1), ",", -1, vbTextCompare) + 1))

RBS


"Mary" wrote in message
...
Hi - I have explained this a bit better now -

If I have a cell and the contents are like this
here are 3 examples -

GREENGATES S.P, APPERLEY RD, GREENGATES, BRADFORD, BD10
0PU

SILSDEN, CRINGLES, SILSDEN, KEIGHLEY, BD20

MIDDLESMOOR SERVICE RES, MIDDLESMOOR SERVICE RES,
HARROGATE, NORTH YORKSHIRE, , HG3

How can I get the postcodes out of those cells? for now I
just want them to go into the same row in the end column.

any tutorials or similar or pages with similar stuff on
would be great. Thanks

Mary


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Postcode problem better explained

Mary,

You could use the formula

=TRIM(MID(A1,FIND("~",SUBSTITUTE(A1,",","~",LEN(A1 )-LEN(SUBSTITUTE(A1,",",""
))))+1,99))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mary" wrote in message
...
Hi - I have explained this a bit better now -

If I have a cell and the contents are like this
here are 3 examples -

GREENGATES S.P, APPERLEY RD, GREENGATES, BRADFORD, BD10
0PU

SILSDEN, CRINGLES, SILSDEN, KEIGHLEY, BD20

MIDDLESMOOR SERVICE RES, MIDDLESMOOR SERVICE RES,
HARROGATE, NORTH YORKSHIRE, , HG3

How can I get the postcodes out of those cells? for now I
just want them to go into the same row in the end column.

any tutorials or similar or pages with similar stuff on
would be great. Thanks

Mary



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Postcode problem better explained

On Sat, 26 Feb 2005 09:50:04 -0800, "Mary"
wrote:

Hi - I have explained this a bit better now -

If I have a cell and the contents are like this
here are 3 examples -

GREENGATES S.P, APPERLEY RD, GREENGATES, BRADFORD, BD10
0PU

SILSDEN, CRINGLES, SILSDEN, KEIGHLEY, BD20

MIDDLESMOOR SERVICE RES, MIDDLESMOOR SERVICE RES,
HARROGATE, NORTH YORKSHIRE, , HG3

How can I get the postcodes out of those cells? for now I
just want them to go into the same row in the end column.

any tutorials or similar or pages with similar stuff on
would be great. Thanks

Mary



I'm not sure what a "post code" is. But looking at your data, it seems as if
it is the last entry in your record and is preceded by a comma.

Accordingly, you may use the Data/Text to Columns Wizard with Comma specified
as the separator; or you may try this formula:

=TRIM(MID(A1,1+FIND(CHAR(1),SUBSTITUTE(A1,",",
CHAR(1),LEN(A1)-LEN(SUBSTITUTE(A1,",","")))),255))


--ron


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default the formats

I think that the format all postcodes take is like this
LLNN NLL.

But maybe we could specify to collect and write any of
the formats below -

LS (LL)
LS2 (LLN)
LS2 6 (LLN_N)
LS2 6N (LLN_NL)
LS2 6NL (LLN_NLL)
LS26 (LLNN)
LS26 6 (LLNN_N)
LS26 6N (LLNN_NL)
LS26 6NL (LLNN_NLL)

(_ indicating a space, L = Letter, N = Number)

This would solve the problem if there were a comma then
some more information like a telephone number following
it.

Would your suggestions get it if this were so?

Thanks

-----Original Message-----
Hi - I have explained this a bit better now -

If I have a cell and the contents are like this
here are 3 examples -

GREENGATES S.P, APPERLEY RD, GREENGATES, BRADFORD, BD10
0PU

SILSDEN, CRINGLES, SILSDEN, KEIGHLEY, BD20

MIDDLESMOOR SERVICE RES, MIDDLESMOOR SERVICE RES,
HARROGATE, NORTH YORKSHIRE, , HG3

How can I get the postcodes out of those cells? for now

I
just want them to go into the same row in the end column.

any tutorials or similar or pages with similar stuff on
would be great. Thanks

Mary
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
META Tags Explained And How To Use Them For Ranking 88059355 Excel Worksheet Functions 0 January 16th 08 04:25 PM
How to locate the first digit in a cell, explained [email protected] Excel Worksheet Functions 7 May 10th 07 09:38 PM
M25 postcode VBA Noob Excel Worksheet Functions 6 August 6th 06 12:12 PM
Counting Formulas -- Re-explained MAB Excel Worksheet Functions 2 January 12th 06 09:18 PM
Postcode splitting problem Mary Excel Programming 2 March 7th 05 09:15 AM


All times are GMT +1. The time now is 06:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"