+ Reply to Thread
Results 1 to 4 of 4

Can I merge rows to columns

  1. #1
    miche
    Guest

    Can I merge rows to columns

    I have exported a Macro report into excell. I need to merge two rows into
    one row. Is this possible, and if so how. I am a beginner.

  2. #2
    Peo Sjoblom
    Guest

    Re: Can I merge rows to columns

    Can you explain why you want to do this? Merged cells cause a lot of
    problems down the road, everything from sorting, copying and pasting. So if
    that is what you want I advice against it but you select the cells in
    question and do format>cells>alignment and check merge cells. Note that only
    the values in the left uppermost cell will be kept.

    If you only meant concatenate values you can use

    =A1&A2


    --

    Regards,

    Peo Sjoblom

    http://nwexcelsolutions.com


    "miche" <[email protected]> wrote in message
    news:[email protected]...
    >I have exported a Macro report into excell. I need to merge two rows into
    > one row. Is this possible, and if so how. I am a beginner.




  3. #3
    David McRitchie
    Guest

    Re: Can I merge rows to columns

    Hi Miche,
    In order to write a macro you have to explain exactly what you want to
    to do. This might get you started. You might include & " " &
    in your concatenation or & CHR(10) &


    Sub combine_evenrow_up()
    Dim r As Long, i As Long, c As Long
    Dim cRow As Long
    cRow = ActiveCell.Row
    For r = cRow To 2 Step -2
    For c = 1 To 20 'rough coding 20006-04-07 d.mcr
    Cells(r - 1, c) = Trim(Cells(r - 1, c)) & Trim(Cells(r, c))
    Next c
    Cells(r, 1).EntireRow.Delete
    Next r
    End Sub

    Run this on test data it is going to go up from the row you have
    your active cell on and work on the first 20 columns then delete the
    rows that got copied upward. Intended to run up from an even numbered
    row if you have no headers.
    Don't know if you are familiar with macros or not, you say you ran a macro
    report, which is ambiguous.
    ---
    HTH,
    David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

    "Peo Sjoblom" <peo.sjoblom@nw^^excelsolutions.com> wrote in message news:[email protected]...
    > Can you explain why you want to do this? Merged cells cause a lot of
    > problems down the road, everything from sorting, copying and pasting. So if
    > that is what you want I advice against it but you select the cells in
    > question and do format>cells>alignment and check merge cells. Note that only
    > the values in the left uppermost cell will be kept.
    >
    > If you only meant concatenate values you can use
    >
    > =A1&A2
    >
    >
    > --
    >
    > Regards,
    >
    > Peo Sjoblom
    >
    > http://nwexcelsolutions.com
    >
    >
    > "miche" <[email protected]> wrote in message
    > news:[email protected]...
    > >I have exported a Macro report into excell. I need to merge two rows into
    > > one row. Is this possible, and if so how. I am a beginner.

    >
    >




  4. #4
    ANdras
    Guest

    Re: Can I merge rows to columns

    Hi Miche,

    i am not sure what you want to achieve....
    however, if you want, you can COMBINE the VALUES of two (or more) columns
    into one
    =A1&B1&C1... and so on.
    or even you can add spaces (to see the content easier)
    =A1&" "&B1&" "&C1.....

    also there is a function doing exactly this, but since i am using local
    Excel, don't know exactly the EN name, (mirror translation could be: combine
    or concatenate or whatever similar :-)

    Is this what you would like to do?
    Best regards,
    ANdras
    (Hungary)

    "David McRitchie" wrote:

    > Hi Miche,
    > In order to write a macro you have to explain exactly what you want to
    > to do. This might get you started. You might include & " " &
    > in your concatenation or & CHR(10) &
    >
    >
    > Sub combine_evenrow_up()
    > Dim r As Long, i As Long, c As Long
    > Dim cRow As Long
    > cRow = ActiveCell.Row
    > For r = cRow To 2 Step -2
    > For c = 1 To 20 'rough coding 20006-04-07 d.mcr
    > Cells(r - 1, c) = Trim(Cells(r - 1, c)) & Trim(Cells(r, c))
    > Next c
    > Cells(r, 1).EntireRow.Delete
    > Next r
    > End Sub
    >
    > Run this on test data it is going to go up from the row you have
    > your active cell on and work on the first 20 columns then delete the
    > rows that got copied upward. Intended to run up from an even numbered
    > row if you have no headers.
    > Don't know if you are familiar with macros or not, you say you ran a macro
    > report, which is ambiguous.
    > ---
    > HTH,
    > David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
    > My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
    > Search Page: http://www.mvps.org/dmcritchie/excel/search.htm
    >
    > "Peo Sjoblom" <peo.sjoblom@nw^^excelsolutions.com> wrote in message news:[email protected]...
    > > Can you explain why you want to do this? Merged cells cause a lot of
    > > problems down the road, everything from sorting, copying and pasting. So if
    > > that is what you want I advice against it but you select the cells in
    > > question and do format>cells>alignment and check merge cells. Note that only
    > > the values in the left uppermost cell will be kept.
    > >
    > > If you only meant concatenate values you can use
    > >
    > > =A1&A2
    > >
    > >
    > > --
    > >
    > > Regards,
    > >
    > > Peo Sjoblom
    > >
    > > http://nwexcelsolutions.com
    > >
    > >
    > > "miche" <[email protected]> wrote in message
    > > news:[email protected]...
    > > >I have exported a Macro report into excell. I need to merge two rows into
    > > > one row. Is this possible, and if so how. I am a beginner.

    > >
    > >

    >
    >
    >


+ 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