+ Reply to Thread
Results 1 to 6 of 6

If cell contains certain values merge adjacent cells

  1. #1
    Registered User
    Join Date
    12-04-2013
    Location
    Jacksonville, FL
    MS-Off Ver
    Excel 2010
    Posts
    7

    If cell contains certain values merge adjacent cells

    I am a newbie here, so I hope I am posting this correctly and providing enough information about my need.

    My sheet contains two columns, column A with numbers, column B with text. I want to merge the text in the column B cells if the numbers in column A meet certain criteria. Two examples: if the numbers are 1, merge the cells in B. And if the numbers are 2, 3, or 4, merge the cells in B.

    I have searched this forum and others and find similar situations, but not exactly. I am too new at this to understand the other solutions enough to modify to suit my needs. Thanks in advance

    My sample sheet is attached.simple sample.xlsx

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: If cell contains certain values merge adjacent cells

    Hi mstew

    Welcome to the Forum!!

    Based on your Sample File include a Worksheet that includes your expected results.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,496

    Re: If cell contains certain values merge adjacent cells

    if the numbers are 1, merge the cells in B
    So concatenate cell A and cell B with the result in B?
    And if the numbers are 2, 3, or 4, merge the cells in B.
    So concatenate cell A and cell B with the result in B?
    As you explain it here, it does not matter what the numbers are, always concatenate.
    i.e. if cell A2 has a 1 and cell B2 has Hello, cell B2 should become 1Hello?

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: If cell contains certain values merge adjacent cells

    @jolivanes

    So it seems
    As you explain it here, it does not matter what the numbers are, always concatenate
    I'd like to see expected results...

  5. #5
    Registered User
    Join Date
    12-04-2013
    Location
    Jacksonville, FL
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: If cell contains certain values merge adjacent cells

    jaslake, Thanks for asking for the expected results, which showed me Excel can't do what I was hoping.

    I am going to have modify my question. From the Forum rules, it seems that best way to do this is to re-post instead of modifying, so I will contact the moderator to get this one deleted.

    jolivanes, thanks for your help, too. Yes, I am looking to concatenate certains cells, but not the way you were suggesting.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: If cell contains certain values merge adjacent cells

    Hi mstew

    Let me know...we'll look at it...

+ 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 If adjacent cells are the same
    By ratdogexcel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-26-2013, 11:58 AM
  2. Replies: 3
    Last Post: 07-30-2012, 11:20 AM
  3. auto merge adjacent cells into one if cell values are equal
    By egosselin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2012, 12:24 AM
  4. Merge Cells based on an adjacent row of values
    By Metal Head in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-04-2011, 09:55 AM
  5. Format cell based on adjacent cells values
    By the majestic ferny in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-16-2005, 02:35 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