Hi acvegas
I struggle as well with some of my own earlier made messy lists, having unfortunately not taken enough care initially. I sympathise, - it is difficult when you make lists before you learn any programming, as i did.
There is a thing in VBA called the Collections Object. It seems to be able to do close to wonders, guessing the correct format something like Google often does. I have seen some experts here do wonders with it to sort messy lists into a more ordered one, for example..
http://www.excelforum.com/excel-prog...ml#post4200033
This requires accordingly an extreme level of expertise. I suspect the people in the world that could apply the Collections Object solution successfully to your data you can count on one hand, but you may be lucky as i think they may participate in this forum sometimes..
Unfortunately i am just a beginner / Novice myself and cannot mannage that Collections Object stuff!.
But
How about an in between solution that might help a bit. It probably does not do the job for you completely, and with more real data it would probably be even worse.
_ But the idea is this:
_1) You copy your data to the first Excel Spreadsheet column.
I use for now the data from Post #1. , and I go with your requirement from then for now, ( You seem to have just changed what you want in your last post ? )
_2 ) you run the code i give you. It attempts to chop up the data as you want it into columns C to G
_3) You would probably then need still to scroll down manually and make some corrections where the code got it wrong.
_4) Having done that it is fairly easy to write a code that will convert those new columns into a text file in the form that you want.
_..................
_ So I start with the data you gave pasted in column A ( I leave as is usual practice the first Row empty for use as a Header)
Using Excel 2007
Row\Col |
A |
2 |
BC Fraternity - 1160 Peachtree Street, NW, Suite: 1604, Atlanta, Georgia 30303 |
3 |
Good Day - 2003 Saint Paul Street, Baltimore, MD 21218 - support@apa1123.net |
4 |
Westgate Services, 2311-24 North Broad Street, Philadelphia, PA 19132-4590 - info@kappaaweqsi1911.com |
5 |
Omega Fraternity, Inc. - 3221 Snapfinger Parkway, Decatur, Georgia 30035 - info@osdpf.org |
6 |
Walstore Inc. - 105 Kennedy Street, NW Washington, DC 20011-5294 - info@ibfghsigma1914.org |
7 |
Sigma, Inc - 7022 Commerce Street, Suite 620, Dallas, Texas 75202 |
8 |
Cookie - Founders Hall, 1600 N. Calvert Street, Baltimore, MD 21202 – grandpo234@iotaphitheta.org, grandvice567@iotaphitheta.org |
_.....
After running my code You get this:
Row\Col |
C |
D |
E |
F |
G |
H |
1 |
Company |
Street/Mail Address |
City |
State |
Zip-code |
Email Address |
2 |
BC Fraternity |
1160 Peachtree Street |
NW |
Atlanta |
Georgia 30303 |
|
3 |
Good Day |
2003 Saint Paul Street |
Baltimore |
MD |
21218 |
support@apa1123.net |
4 |
Westgate Services |
2311-24 North Broad Street |
Philadelphia |
PA |
19132-4590 |
info@kappaaweqsi1911.com |
5 |
Omega Fraternity Inc. |
3221 Snapfinger Parkway |
Decatur |
Georgia |
30035 |
info@osdpf.org |
6 |
Walstore Inc. |
105 Kennedy Street |
NW Washington |
DC |
20011-5294 |
info@ibfghsigma1914.org |
7 |
Sigma Inc |
7022 Commerce Street |
Dallas |
Texas |
75202 |
|
8 |
Cookie - Founders Hall |
1600 N. Calvert Street |
Baltimore |
MD |
21202 |
grandpo234@iotaphitheta.org, grandvice567@iotaphitheta.org |
(_
You will note it only gets the first of your Rows wrong. You had a very wiered order of things there)
_ The program is unfortunately very messy, mirroring your messy data. I made up the Replacing bits as i went along using your test data.
_ But I have
'commented my code extensively, so You may be able, once You have understood it, to play around a bit more with it to get exactly what You want
Hope that is some help
Please let us know how you get on
Alan
Code is here:
http://www.excelforum.com/developmen...ml#post4288852
and here
http://www.excelforum.com/developmen...ml#post4288953
Note it is all one code. I had to split it to get it all in due to Forum Post Size Limitations
You Need to Copy the second part
directly under the first part in the
Same Code Module
Bookmarks