Computing.Net > Forums > Programming > read column info into a continous string

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

read column info into a continous string

Reply to Message Icon

Name: chaft
Date: June 15, 2009 at 10:12:53 Pacific
OS: Windows Vista
CPU/Ram: 2.1/4gb
Product: Acer / ASPIRE
Subcategory: General
Comment:

Hi,
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
-ford
-honda
-ferrari
-porsche

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



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: June 17, 2009 at 08:41:14 Pacific
Reply:

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, ";")


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: read column info into a continous string

C++ read file info - please help! www.computing.net/answers/programming/c-read-file-info-please-help/12188.html

One line of a .txt file in VB6 www.computing.net/answers/programming/one-line-of-a-txt-file-in-vb6/8248.html

How to read whole file? (C++) www.computing.net/answers/programming/how-to-read-whole-file-c/13286.html