+ Reply to Thread
Results 1 to 2 of 2

VBA to merge similar columns in a table

  1. #1
    Registered User
    Join Date
    05-02-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    6

    Question VBA to merge similar columns in a table

    Hi, in the attached I have an export from JIRA that has some repeated columns label, label2, label3 and Comment, Comment4, Comment5 these two Label and Comment can be bigger that just 3 examples but the current export happens to just have 3 of each.

    I have some code already that will merge the data of the comments with a line break into a single cell after selecting the columns that are similar:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I could do this for labels as well as it is based on a manual selection, however I would like to automate this.

    I also have the following that creates a table of the exported data and hides columns we don't care about for the purpose of presenting this data, but we don't want to lose hence only hiding columns.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I have some basic idea of working with tables but I cant get into my head how to search for the headers that start Labels and get their numbers to then select and use the merge code I already have on them. then repeat with the comments ones.
    attached is an example of the data from JIRA.
    Attached Files Attached Files

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: VBA to merge similar columns in a table

    Table Headers in VBA are referenced the same way as they are in Excel TableName[[#Headers][Header Name]]

    So (and this is "air code')
    Please Login or Register  to view this content.
    Gets you a list of the column header names. cl.Column will tell you which column the headers are in.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. "merge" similar rows in pivot table?
    By rahel.ba in forum Excel General
    Replies: 1
    Last Post: 05-30-2023, 11:03 AM
  2. Pivot Table Question - Similar Data over Multiple Columns
    By thenotoriousjeff in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-14-2016, 03:40 PM
  3. [SOLVED] Merge similar cells in column and adjacent columns
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2016, 06:58 AM
  4. Index search, Merge rows or columns in table format
    By loled in forum Excel General
    Replies: 0
    Last Post: 06-16-2015, 12:02 AM
  5. Need to merge columns with similar locations
    By aleanboy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-08-2014, 04:25 PM
  6. sum columns, similar to pivot table
    By Solarissf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2008, 03:48 PM
  7. Merge table columns and data from various excel workbooks into another
    By borat in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-12-2007, 11:27 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