+ Reply to Thread
Results 1 to 5 of 5

Merge cells next to cell

  1. #1
    Forum Contributor
    Join Date
    11-01-2012
    Location
    NJ
    MS-Off Ver
    Excel 365
    Posts
    109

    Merge cells next to cell

    Hi,
    Can anyone advise to help fix the below?

    In Column F , G, and H (merged cells) there are multiple occurrences of the word "** Conclusion". What I would like to do is when each occurence is found, merge the two cells next to the occurence (columns I and J) and also merge the two cells next to the that (Columns K and L)

    I have the following code, but I can't even get it to merge the two cells next to the first occurence of "** Conclusion" correctly

    Please Login or Register  to view this content.
    Thanks!

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Merge cells next to cell

    Try:

    Please Login or Register  to view this content.
    The G and H don't need to be spelled out. The content only exists in F.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Merge cells next to cell

    Maybe:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    11-01-2012
    Location
    NJ
    MS-Off Ver
    Excel 365
    Posts
    109

    Re: Merge cells next to cell

    You guys are great!! Both worked! Amended Johns just slightly as it was merging couple columns over! Great stuff!

    Thank you both!!
    [code]
    Dim rcell As Range
    For Each rcell In Range("F5:H" & Range("F" & Rows.Count).End(xlUp).Row)
    If rcell.Value Like "** Conclusion" Then
    Range(rcell.Offset(, 1), rcell.Offset(, 2)).MergeCells = True
    Range(rcell.Offset(, 3), rcell.Offset(, 4)).MergeCells = True
    End If
    Next rcell
    [code/]

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Merge cells next to cell

    You're welcome. If you are satisfied with the solutions provided please mark this thread as solved.

+ 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. Replies: 3
    Last Post: 09-29-2014, 02:32 PM
  2. Replies: 5
    Last Post: 11-21-2013, 06:00 PM
  3. Merge cells - empty cells with a cell with value
    By suravi086 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-11-2013, 07:51 AM
  4. [SOLVED] Need to merge cells few blank cells based on a value of a cell in the same row
    By skandkamat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-03-2013, 01:33 AM
  5. How do I merge one cell into two cells?
    By auntieboop in forum Excel General
    Replies: 1
    Last Post: 05-30-2006, 11:10 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