+ Reply to Thread
Results 1 to 9 of 9

Trying to Create macro that will merge rows/columns

  1. #1
    Registered User
    Join Date
    11-15-2022
    Location
    Madison, WI
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Trying to Create macro that will merge rows/columns

    I am trying to create a macro that emulates some functionality found in the ablebits/kutools add-ons.

    Essentially I have a table in which many of the columns (can be transposed to rows if needed) are the same except one.

    What I want to do is combine all the columns/rows that share a common value (lets say claim ID) and merge that unlike column into one delimited by a comma [space].

    Note: Sometimes the columns will have 0, sometimes it will have like 5 that need to be merged. Can vary from entry to entry.

    Edit: Included a brief example.
    Example Doc.xlsx
    Last edited by mochmaster; 11-15-2022 at 12:02 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Trying to Create macro that will merge rows/columns

    Hi mochmaster and welcome to the forum,

    We need a sample workbook to really solve your question. See the yellow area above to attach a file.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    11-15-2022
    Location
    Madison, WI
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Trying to Create macro that will merge rows/columns

    Yup that was my bad, just added one. Took me a second to figure out the attachment system.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Trying to Create macro that will merge rows/columns

    Hi mochmaster,

    I'd try a Transpose on your data to work with it easier. See the attached to get my possible answer.
    Example Doc Transpose is Better.xlsx

    If you really needed the items in a single cell then a TextJoin might help with that.

  5. #5
    Registered User
    Join Date
    11-15-2022
    Location
    Madison, WI
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Trying to Create macro that will merge rows/columns

    Yeah as it stands right now, I am using the ablebits add-on. I transpose the data, run the tool, then transpose it back. Unfortunately I need the data all in one cell as i have it laid out (it makes more sense in the actually doc).

    Textjoin does seem handy, but in my brain I'm not sure how to get around the circular referencing. Like if i need rows 2-5 to be concatenated, how do i have it include row 2 in row 2?

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Trying to Create macro that will merge rows/columns

    Hey mochmaster,

    What alebits formula are you using? Would you accept a VBA solution?
    Maybe one of the smart Gurus can come up with a better answer than mine.

  7. #7
    Registered User
    Join Date
    11-15-2022
    Location
    Madison, WI
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Trying to Create macro that will merge rows/columns

    Hey Marvin,

    VBA would be perfect. The name of the ablebits functionality is called merge duplicates. More info can be found here : (www)ablebits.com/excel-combine-rows/index.php (too new to post link properly)

    Thanks

  8. #8
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,419

    Re: Trying to Create macro that will merge rows/columns

    Or try a formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-15-2022
    Location
    Madison, WI
    MS-Off Ver
    Microsoft 365
    Posts
    5

    Re: Trying to Create macro that will merge rows/columns

    Thanks for the input. I could see this being a potential work around. Ideally I'd have it filter in place. Also I'm going to need to disect this a little to figure out how to adapt it for variable amounts of columns and or include more rows than just the two.

+ 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. Macro for multiple rows to create new rows with data in columns
    By Cari R in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-25-2021, 01:42 PM
  2. Macro To Create rows to capture data in Columns
    By sirm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-13-2018, 03:12 PM
  3. Macro to create multiple rows with similar columns
    By bkelly0721 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-24-2015, 02:55 PM
  4. Merge Duplicate Rows unique values into single rows for an infinite amount of columns/rows
    By aimeecrystalaid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2013, 08:43 PM
  5. [SOLVED] Create macro to compare two rows and if two columns agree merge all
    By Poseidons-Palace in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-28-2012, 03:46 PM
  6. [SOLVED] Merge duplicate rows and merge the columns (approx 10 columns)
    By adfeddon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-02-2012, 11:19 AM
  7. Macro to delete certain rows and create columns
    By excel77 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-14-2010, 10:06 AM

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