LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 86
Default Parsing (again)


AAINEY J 1193 STRATHCONA DR SW CALGARY, AB T3H4S1 (403) 293-2671
(403) 293-2671

I want to be able to extract the City. Province, and Postal Code from rows
like the above string. There are no fixed length fields.
I want to be able to use a variable in the final code to open a file, based
on the city name, so looking up CALGARY won't work. On the other hand, the
comma is common to all rows. so if I can search back from the comma to a
space, and forward 3 characters I'm OK. On the other hand, it won't handle
cities like LAS VEGAS, but I can ask users to name it LAS_VEGAS.

An option would be to get everything (CALGARY, AB T3H4S1) into one field. I
can then parse it out from there.

The code will look something like:
..Range("F1:F" & n).FormulaR1C1 = "=MID(R[0]C[-5],FIND("","",R[0]C[-5])+2,2)"
'I think this should get AB
..Range("G1:G" & n).FormulaR1C1 = "=MID(R[0]C[-6],FIND("","",R[0]C[-6])+5,6)"
' and this should extract T3H4S1


Thanks
Jim Berglund

 
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
Text parsing HELP jdavistdi Excel Discussion (Misc queries) 11 February 9th 11 04:34 PM
Parsing Saxman[_2_] Excel Discussion (Misc queries) 3 July 30th 07 04:36 PM
Instead of Parsing Krish Excel Discussion (Misc queries) 1 November 4th 06 08:32 PM
Parsing a name Budget Programmer Excel Programming 2 August 19th 06 05:13 AM
Parsing help Richard[_12_] Excel Programming 0 July 27th 03 12:50 PM


All times are GMT +1. The time now is 01:44 AM.

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

About Us

"It's about Microsoft Excel"