read column info into a continous string

June 15, 2009 at 10:12:53
Specs: Windows Vista, 2.1/4gb
I'm having a difficulty reading a column using a macro/vba into a string whereby it doesn't overwrite the string each time it grabs a new row's info from a column.

for instance say we have four car manufacturers

car manufacturer

each time i get the column rows to assign it to a string, it overwrites the last. So inevitably I end up with the last one that is read; in this case it would be porsche.

what i'd like it to do is put it all on the same line for example:

ford; honda; ferrari; porsche

The reason I want to do this is so that in my microsoft access database I can read the 'email column' and grab all the emails and put it in the 'TO:' box in an outlook email..

Any ideas or methods would be great. Thanks

See More: read column info into a continous string

Report •

June 17, 2009 at 08:41:14
Dim c As Range, d As Object
Set d = CreateObject("Scripting.Dictionary")
For Each c In Selection
  If Not d.Exists(c.Value) Then _
    d.Add c.Value, 0
Next c
MsgBox Join(d.Keys, ";")

Report •
Related Solutions

Ask Question