MERGE COLUMNS

IF YOU HAVE EXCEL 2003 AND HIGHER YOU CAN CREATE MACROS
WHICH TO MERGE THE COLUMNS OR ROWS BETWEEN IT (TO MAKE MORE THAN ONE)
CREATE A MACRO AND THEN ENTER THE CODE NEXT AND PUT IT IN A MODULE IN YOUR WORKBOOK.
THE CODE FOLLOWING:

Sub eliot()

    Set vzone = Selection

    vtxt = vzone.Range("a1").Value

    For i = 2 To vzone.Rows.Count

        vtxt = vtxt & Chr(10) & vzone.Cells(i, 1).Value

        vzone.Cells(i, 1).ClearContents

    Next

    vzone.Range("a1").Value = vtxt

    With vzone

        .HorizontalAlignment = xlCenter

        .VerticalAlignment = xlCenter

        .WrapText = False

        .Orientation = 0

        .AddIndent = False

        .IndentLevel = 0

        .ShrinkToFit = False

        .ReadingOrder = xlContext

        .MergeCells = True

    End With

    vzone.Range("a1").Value = vzone.Range("a1").Value

End Sub

 

AND THEN:

 

SELECT YOUR CELLS AND LAUNCHES THE MACRO THAT YOU HAVE CREATE AND THEN THE COLUMN OR ROW THAT YOU HAS SELECT IT CONCATENATES WITH LINE BREAK ALL THAT IS CONTAINED IN THE CELLS IN THE LEFT COLUMN OF YOUR SELECTION. THIS WORKS WITH THE NUMBER OF ROWS AND COLUMNS YOU WANT.

 

BEFORE YOU MERGE

 

avant-fusion.jpg

AFTER MERGE

apres-fusion.jpg

Découvrez la Radio Rap / Hip Hop

Last edited: 2012-11-03

Make a free website with emyspot - Signaler un contenu illicite sur ce site