This is a messy data problem that I'm not sure can be solved with VBA. But I'll give the forum a crack at it anyway.
I need to create mailing labels from a spreadsheet (a .csv export from an online dbase I can't access) of names and addresses. The spreadsheet has one person per row, columns as follows:
FirstName | LastName | StreetAddress | City | State | ZIP
There's a few other columns in there that aren't relevant and I can easily adjust any code you give me to match the actual spreadsheet.
The problem is that the data contains cases where two to six family members live at the same address, and I want one combined mailing label for them. So I need to combine those six rows into one for that address. Now, I know how to write a code loop to iterate through the rows from bottom to top, combining rows based on an exact match in a specific column.
The complicating factor is that this data is entered by those individuals, and the street address field is often not an exact match for those individuals at that address ("Street" versus "St" versus "St.").
So can anybody think of a way to do an intelligent comparison of street addresses? I thought if the data was sorted by last name, then by street address, I could get away with using Left() function to just look for matches in the first five characters, but some unrelated addresses (like PO Boxes) match in the first five characters...
I even thought of pushing the address out to the web to be geocoded, but that seems like an excessively bulky workaround... (right?)
Scratching my head...
VBAjedi
I need to create mailing labels from a spreadsheet (a .csv export from an online dbase I can't access) of names and addresses. The spreadsheet has one person per row, columns as follows:
FirstName | LastName | StreetAddress | City | State | ZIP
There's a few other columns in there that aren't relevant and I can easily adjust any code you give me to match the actual spreadsheet.
The problem is that the data contains cases where two to six family members live at the same address, and I want one combined mailing label for them. So I need to combine those six rows into one for that address. Now, I know how to write a code loop to iterate through the rows from bottom to top, combining rows based on an exact match in a specific column.
The complicating factor is that this data is entered by those individuals, and the street address field is often not an exact match for those individuals at that address ("Street" versus "St" versus "St.").
So can anybody think of a way to do an intelligent comparison of street addresses? I thought if the data was sorted by last name, then by street address, I could get away with using Left() function to just look for matches in the first five characters, but some unrelated addresses (like PO Boxes) match in the first five characters...
I even thought of pushing the address out to the web to be geocoded, but that seems like an excessively bulky workaround... (right?)
Scratching my head...
VBAjedi