Merge Cells based on used cells in column 5

  • I have data written in Cells B5, C5, D5 etc that changes as you add more column data


    I am trying to figure out how to merge cells starting from Cell B3 based on used cells in row B5 to end of column.

  • Re: Merge Cells based on used cells in column 5


    No idea what you mean...


    Please upload a sample workbook showing before and after.


    On another tack, why would you want to merge cells? It makes it nearly impossible to manipulate the data.

  • Re: Merge Cells based on used cells in column 5


    Could not understand your actual scenario. But still, you can use the below code for Merging cells.

    Code
    Sub Merge_cells()
        ThisWorkbook.Sheets(1).Activate
        ThisWorkbook.Sheets(1).Range("B4:D4").Select
        Selection.Merge
    End Sub
  • Re: Merge Cells based on used cells in column 5


    There's no attachment.


    However, I would not ignore Cytop's advice on merging cells, quite simply - don't!

  • Re: Merge Cells based on used cells in column 5


    Try


    But note that if the selection is too narrow (2 or 3 cells only) then the text will offset to the left so it centers over the existing text... This can be avoided by other formatting like row height and word wrap.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!