+ Reply to Thread
Results 1 to 9 of 9

If cell values equal, then merge cells

  1. #1
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Arrow If cell values equal, then merge cells

    Hey folks,

    I need a macro or formula to merge cells with identical content. Any ideas on the best way to do this?

    Cheers!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: If cell values equal, then merge cells

    Try this

    Please Login or Register  to view this content.
    I've assumed that you want to merge both horizontally and vertically.
    Martin

  3. #3
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: If cell values equal, then merge cells

    Cheers for that MRICE,
    I'm just about to get working on this now so I'll let you know how I get on.
    thanks again.

  4. #4
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: If cell values equal, then merge cells

    This is almost exactly what Im looking for.

    The only issue is that in some instances this code will need to merge mabe 5 or 6 cells (with identical content) on a verticle axis.

    Is there a way of changing this code so that it will continue to merge identicle cells until a cell containing differant content or a null cell is reached?

    Cheers again!

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: If cell values equal, then merge cells

    Can you provide an example as an attachment of a scenario that is currently not covered by the code and show what you would like it to look like?

  6. #6
    Forum Contributor
    Join Date
    02-24-2010
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2003
    Posts
    195

    Re: If cell values equal, then merge cells

    Sure thing. I've attached an example before & after data set now.

    Thanks again for your help on this.
    Attached Files Attached Files

  7. #7
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: If cell values equal, then merge cells

    This works on your sample data.

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    10-02-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: If cell values equal, then merge cells

    Martin,

    I have a similar situation, but I want to merge the names in column A. Can you please assist with how I would need to alter the above code to do this?

    My spread sheet is on a very large scale also and there may be up to 100 names that need to be merged at times. Do I need to change any other parts of the code to accommodate for this?

    thanks

    Sue.

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: If cell values equal, then merge cells

    Sue,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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