+ Reply to Thread
Results 1 to 17 of 17

Concatenate long list with punctuation (email list)

Hybrid View

  1. #1
    Registered User
    Join Date
    11-05-2015
    Location
    Kelowna, Canada
    MS-Off Ver
    2010
    Posts
    8

    Concatenate long list with punctuation (email list)

    anyone know how I can concatenate a whole column of email addresses into a single cell with "; " (semicolon space) between each email? I want users -- who are mostly unfamiliar with excel and from a variety of organizations (so I can't do a distribution list) -- to be able to use the most up to date list of members and grab all the emails from one cell (so I can't do a distribution list) and copy/paste it into the outlook send box.
    They likely won't understand they can select the column, copy, and paste it because it will look so odd in the send box. I want them to feel safe and comfortable doing it.
    The only solution I can find is =concatenate(d5,"; ",d6,"; ",d7,"; ",etc to d45) which would take forever to type in AND wouldn't automatically add in any new members to the list (because d46 isn't in the function).
    Is there a better way to do it? (I don't mind doing a series of functions in the background, as long as the cell visible to the group has the complete list of emails).
    Thanks!
    Last edited by cathyrd; 11-05-2015 at 06:29 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,346

    Re: Concatenate long list with punctuation (email list)

    Look for ConcatAll in this forum ... attributed to TigerAvatar.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    11-05-2015
    Location
    Kelowna, Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Concatenate long list with punctuation (email list)

    Will give it a try and let you know. His =ConcatAll(range:range,"; ") didn't work. I'll look at the replies to his post.
    Last edited by cathyrd; 11-05-2015 at 03:28 PM.

  4. #4
    Registered User
    Join Date
    11-05-2015
    Location
    Kelowna, Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Concatenate long list with punctuation (email list)

    I ended up putting "; " (semicolon space) in a cell E5, then starting function as (column D being my list):
    =concatenate(d5,e5,
    Then I copied ,e5, from the formula so I could easily paste it in, and finished formula as:
    =concatenate(d5,e5,d6,e5,d7,e5,....to d40)
    It went quickly because I could keep my left hand at Ctrl V D, then use right hand on number keyboard.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Concatenate long list with punctuation (email list)

    This VBA solution will concatenate the list in column D to Cell E1. You can then copy and paste this into Outlook

    Option Explicit
    
    Sub email()
        Dim lr As Long
        Dim i As Long
        lr = Range("D" & Rows.Count).End(xlUp).Row
        Dim r As Range
        Set r = Range("E1")
        
        Application.ScreenUpdating = False
        For i = 1 To lr
        r.Value = r.Value & Range("D" & i) & ";"
        Next i
        Application.ScreenUpdating = True
    
    End Sub
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Forum Contributor Obsessed's Avatar
    Join Date
    05-22-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 365
    Posts
    215

    Re: Concatenate long list with punctuation (email list)

    Quote Originally Posted by alansidman View Post
    This VBA solution will concatenate the list in column D to Cell E1. You can then copy and paste this into Outlook

    Option Explicit
    
    Sub email()
        Dim lr As Long
        Dim i As Long
        lr = Range("D" & Rows.Count).End(xlUp).Row
        Dim r As Range
        Set r = Range("E1")
        
        Application.ScreenUpdating = False
        For i = 1 To lr
        r.Value = r.Value & Range("D" & i) & ";"
        Next i
        Application.ScreenUpdating = True
    
    End Sub
    Just a heads up...while this is the method I'd personally use, you want to add a line in there to remove the trailing ";" at the end of the string:

    Quote Originally Posted by alansidman View Post
    Option Explicit
    
    Sub email()
        Dim lr As Long
        Dim i As Long
        lr = Range("D" & Rows.Count).End(xlUp).Row
        Dim r As Range
        Set r = Range("E1")
        
        Application.ScreenUpdating = False
        For i = 1 To lr
        r.Value = r.Value & Range("D" & i) & ";"
        Next i
        r.Value = Left(r.Value,Len(r.Value) - 1)
        Application.ScreenUpdating = True
    
    End Sub
    Want to show appreciation for the help you received from a member? Give them reps by clicking the bottom left of their post!

  7. #7
    Registered User
    Join Date
    12-14-2022
    Location
    Albany, NY
    MS-Off Ver
    10
    Posts
    1

    Re: Concatenate long list with punctuation (email list)

    This absolutely made my day! Worked like a charm, thank you!!

  8. #8
    Registered User
    Join Date
    11-05-2015
    Location
    Kelowna, Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Concatenate long list with punctuation (email list)

    Nope, didn't work, am not able to code on my work network.

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Concatenate long list with punctuation (email list)

    Did you test my VBA solution in #3 post?

  10. #10
    Registered User
    Join Date
    11-05-2015
    Location
    Kelowna, Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Concatenate long list with punctuation (email list)

    Sorry, not a tekkie - have never used VBAs and don't even know what they are....

  11. #11
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,719

    Re: Concatenate long list with punctuation (email list)

    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button

  12. #12
    Registered User
    Join Date
    11-05-2015
    Location
    Kelowna, Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Concatenate long list with punctuation (email list)

    Thanks! I got to #7. Am stuck on running the VBA code. Did I need to edit the code to enter in ranges? Do I select a cell to run the macro in? Thanks for your patience.

  13. #13
    Forum Contributor Obsessed's Avatar
    Join Date
    05-22-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 365
    Posts
    215

    Re: Concatenate long list with punctuation (email list)

    Here you go...nice and simple. Just drag the formula down and use the last one. Will have them all:

    concatenate.JPG

    Yields:

    concatenate2.jpg

  14. #14
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Concatenate long list with punctuation (email list)

    Assuming we are not talking more than 254 cells, you can use this shortcut
    Let's say A1:A5 = A, B,C,D,E

    1. Enter = CONCATENATE(TRANSPOSE(A1:A5)&"; ")

    2. Then in the formula box (white text box where you see the formula), select everything inside the parenthesis and hit F9.
    You'll see = CONCATENATE({"A; ", "B; ", "C; ", "D; ", "E; "})
    3. Remove the brackets and the final "; "

    4. ENTER
    How's that work for you?

    Note: if you were concatenating a row of cells, no need to use TRANSPOSE but the rest is the same
    Last edited by ChemistB; 11-05-2015 at 06:01 PM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  15. #15
    Registered User
    Join Date
    11-05-2015
    Location
    Kelowna, Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Concatenate long list with punctuation (email list)

    ChemistB wins for easiest solution (the transpose solution)!! Wonderful!! Worked like a charm.

  16. #16
    Registered User
    Join Date
    11-05-2015
    Location
    Kelowna, Canada
    MS-Off Ver
    2010
    Posts
    8

    Re: Concatenate long list with punctuation (email list)

    Such a newbie - how do I mark the thread as 'solved'?
    Last edited by cathyrd; 11-05-2015 at 06:28 PM. Reason: want to delete it, found answer

  17. #17
    Forum Contributor Obsessed's Avatar
    Join Date
    05-22-2013
    Location
    Cincinnati, Ohio
    MS-Off Ver
    Excel 365
    Posts
    215

    Re: Concatenate long list with punctuation (email list)

    Thread Tools towards the top right of your first post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 02-22-2015, 11:40 AM
  2. Replies: 1
    Last Post: 02-26-2013, 07:55 PM
  3. [SOLVED] List of Email Addresses that I need to Concatenate into one cell
    By amyp22x3 in forum Excel General
    Replies: 3
    Last Post: 01-17-2013, 03:42 PM
  4. Replies: 10
    Last Post: 01-05-2013, 12:31 PM
  5. [SOLVED] Macro for Long list Concatenate
    By mlj61289 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-05-2012, 01:43 PM
  6. [SOLVED] Short list of values from long list of duplicates
    By Hang Glider in forum Excel General
    Replies: 4
    Last Post: 04-21-2012, 07:13 AM
  7. Replies: 2
    Last Post: 09-24-2010, 12:11 PM
  8. [SOLVED] Using CONCATENATE function to create email addresses from a list
    By Almamba in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-23-2005, 06:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1