Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50262

Extract specific strings within a cell macro

$
0
0
Hi there, essentially I need to extract certain strings in a cell which is badly formatted from a database.

For example the cell A1 could contain:
-
Address: 1 Andrew St,
Washington, USA
Name: Smith
Test ID: 12345
-

I would like to be able to extract the '1 Andrew St, Washington, USA' and '12345' and paste them into a separate cell say B1 and B2 respectively.

I know there's a limiter functionality available but since the cell is badly formatted I don't think I can do that but happy to be corrected. Also the address could be long - say 1 West Andrew Park Avenue so using a limit for the number of characters would not be robust too.

Any ideas?

I understand it might be quite complex so certainly not expecting people to write the code here but any suggestion on what the logic could be is really appreciated.

Thanks in advance.

Viewing all articles
Browse latest Browse all 50262

Trending Articles