Joe4
MrExcel MVP, Junior Admin
- Joined
- Aug 1, 2002
- Messages
- 73,418
- Office Version
- 365
- Platform
- Windows
I have an Excel macro that I wrote years ago that will take all the values from a certain column on a spreadsheet and concatenate them into one long string, with text qualifiers and delimiters of my choosing. It could convert this:
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
joe@abc.com
tom@abc.com
jill@xyz.com
<o> </o>
to something like this:
joe@abc.com;tom@abc.com;jill@xyz.com
<o> </o>
I use this for two distinct purposes:
1. Combine a list of email addresses I want to send something to;
2. Use to build criteria for a SQL statement (i.e. using “IN”)
<o> </o>
A client of mine has an Access database that has a Contact table that contains an email address field. On occasion, they would like to email a subset of that table (can easily select which records with a query). Currently, they export the results of the query to Excel and use my macro to create the email address list. I would like to make this more dynamic, and bypass the Excel step altogether, i.e. have Access combine the list (and maybe export to single record text file).
<o> </o>
I imagine it is going to require VBA (which I have done a lot of), but I haven’t ever really tried combining field values from multiple records down into a single record. Does anyone have any good code links or tips?
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
joe@abc.com
tom@abc.com
jill@xyz.com
<o> </o>
to something like this:
joe@abc.com;tom@abc.com;jill@xyz.com
<o> </o>
I use this for two distinct purposes:
1. Combine a list of email addresses I want to send something to;
2. Use to build criteria for a SQL statement (i.e. using “IN”)
<o> </o>
A client of mine has an Access database that has a Contact table that contains an email address field. On occasion, they would like to email a subset of that table (can easily select which records with a query). Currently, they export the results of the query to Excel and use my macro to create the email address list. I would like to make this more dynamic, and bypass the Excel step altogether, i.e. have Access combine the list (and maybe export to single record text file).
<o> </o>
I imagine it is going to require VBA (which I have done a lot of), but I haven’t ever really tried combining field values from multiple records down into a single record. Does anyone have any good code links or tips?