+ Reply to Thread
Results 1 to 6 of 6

VBA To Concatenate Data

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    VBA To Concatenate Data

    If this can be done using an excel formula, I'm good with that as well, but I think...VBA is the easiest way. I have a spreadsheet with about 2,000 rows in it that houses data in columns A & B that looks like this
    Please Login or Register  to view this content.
    And the format I need the data in is. just like this
    Please Login or Register  to view this content.
    How would I do this?


    EDIT --- not sure why my formatting gets all jacked up when I post this. Essentially how I have the data has name in column A and multiple stores in Column B. So one employee could have 2 rows with 2 different stores listed. I need the data for each employee to have ONE row.

  2. #2
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VBA To Concatenate Data

    Maybe :
    Please Login or Register  to view this content.
    Attached Files Attached Files
    1. I care dog
    2. I am a loop maniac
    3. Forum rules link : Click here
    3.33. Don't forget to mark the thread as solved, this is important

  3. #3
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: VBA To Concatenate Data

    Yes that is exactly what I needed! Thank you!

  4. #4
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA To Concatenate Data

    Thanks a lot Mr. Karedog for awesome code
    As for this part
    Please Login or Register  to view this content.
    Instead of looping to remove the rows inside the array. Isn't it easy to use Redim Preserve to slice those rows after p variable .. and if possible can you show us this part?
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  5. #5
    Forum Guru karedog's Avatar
    Join Date
    10-03-2014
    Location
    Indonesia
    MS-Off Ver
    2003
    Posts
    2,971

    Re: VBA To Concatenate Data

    @jo15765, You are welcome, thanks for marking the thread as solved.

    @Yasser,
    Thanks for rep.points.
    Redim Preserve can only redim the last dimension of an array, in case of 2D array, you can only Redim Preserve to add or delete more columns, but not rows.
    And beside, if only we can do this (using transpose, redim preserved, then re-transpose, which won't worked for large array), the result array would be smaller than original range, which means you still have to write more code to clean the "redundant area" at bottom. Hope it's clear.

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: VBA To Concatenate Data

    Thanks a lot my friend. Yes now it is clear.
    Thank you very much

+ 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. VBA Automatically concatenate cell data based on data, and prefix with specific word.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-30-2017, 02:16 PM
  2. Auto concatenate and reverse concatenate & Remove duplicates .
    By Andy308 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-15-2016, 12:38 PM
  3. [SOLVED] Formula concatenate data in multiple rows based on match data in a different row.
    By kidkool in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2014, 11:01 AM
  4. Replies: 9
    Last Post: 12-13-2013, 07:40 PM
  5. Replies: 3
    Last Post: 09-20-2012, 04:26 PM
  6. Replies: 2
    Last Post: 04-12-2010, 12:35 PM
  7. [SOLVED] [SOLVED] I know how to concatenate ,can one de-concatenate to split date?
    By QUICK BOOKS PROBLEM- in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 07-26-2005, 01:05 PM

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