+ Reply to Thread
Results 1 to 5 of 5

Columns to be merged if value is same ( duplicated )

  1. #1
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Question Columns to be merged if value is same ( duplicated )

    Folks,

    Could you please help me to merge the columns horizontally if values are same (Duplicate). I have attached the work book what I am trying to accomplish.
    Attached Files Attached Files
    Last edited by Pepe Le Mokko; 12-04-2019 at 12:33 PM. Reason: Removed unnecessary title part
    Cheers,

    Joshi
    Being with a winner makes you a winner

  2. #2
    Forum Contributor
    Join Date
    02-04-2010
    Location
    Hertfordshire, England
    MS-Off Ver
    Office 2007 (home) Office 365 (work)
    Posts
    134

    Re: Columns to be merged if value is same ( duplicated )

    Hi krjoshi

    Try the code below which is being applied to row 3
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Columns to be merged if value is same ( duplicated )

    Hi excelxx,

    Thank you so much its working great. But, I would have to merge row 2 also, could you please help.

    Regards,
    Joshi
    Last edited by krjoshi; 12-05-2019 at 11:18 AM.

  4. #4
    Forum Contributor
    Join Date
    02-04-2010
    Location
    Hertfordshire, England
    MS-Off Ver
    Office 2007 (home) Office 365 (work)
    Posts
    134
    Hi Joshi

    In the line of code below


    For Each xC In xOutput.Range(xOutput.Cells(3, 6), xOutput.Cells(3, x))

    Change the 3 to 2, so it becomes


    For Each xC In xOutput.Range(xOutput.Cells(2, 6), xOutput.Cells(2, x))

    And rerun and it would apply to row 2

  5. #5
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Columns to be merged if value is same ( duplicated )

    Hi excelxx, Thank you so much. the code is working great

+ 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. Merged cell with no needed spaces
    By bipenett in forum Excel General
    Replies: 4
    Last Post: 03-25-2021, 02:36 AM
  2. [SOLVED] Create and sum values from columns (from duplicated headers)
    By JoonCB in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-02-2019, 01:31 PM
  3. Index matched array with duplicated matches, help needed!
    By hbuzz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-08-2016, 09:45 AM
  4. Macro adjustment needed: merged cells & countif match
    By djvent in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-23-2014, 04:03 PM
  5. [SOLVED] delete duplicated columns from left to right
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2013, 07:47 AM
  6. Duplicated rows merged to one row?
    By skitz2k1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2010, 08:08 AM
  7. [SOLVED] Finding Duplicated Text within Columns
    By Jen in forum Excel General
    Replies: 1
    Last Post: 02-15-2005, 11:06 AM

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