+ Reply to Thread
Results 1 to 6 of 6

Excel 2010 - Macro to join 5 rows with multiple cells to one row

  1. #1
    Registered User
    Join Date
    03-12-2013
    Location
    virgina
    MS-Off Ver
    Excel 2010
    Posts
    11

    Excel 2010 - Macro to join 5 rows with multiple cells to one row

    I have a spreadsheet with five rows and multiple cells that I would like to combine to one row. Can someone help me with a macro? There are approximately 200 rows in my spreadsheet and I don't want to have to do this individually to each set of data.The data was downloaded as text.

    I am new to macros - sorry

    Example of spreadsheet:

    a b c d e
    f g h i j
    k l m n o
    p q r s t
    u v w x y
    1 2 3 4 5
    6 7 8 9 10
    11 12 13 14 15
    16 17 18 19 20
    21 22 23 24 25
    etc.
    I would like it to look like:

    Row 1 would be: a b c d e f g h i j k l m n o p q r s t u v w x y
    Row 2 woudl be: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

    Thanks.

  2. #2
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    818

    Re: Excel 2010 - Macro to join 5 rows with multiple cells to one row

    Hello fiesty,

    Try it once,

    Please Login or Register  to view this content.
    Kind regards, Harry.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Excel 2010 - Macro to join 5 rows with multiple cells to one row

    Hi Feisty,

    Try this:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard


    Open your Workbook and save it as a macro-enabled workbook

    Press ALT + F11 to open the Visual Basic Editor.

    Select "Module" from the Insert menu

    Type "Option Explicit" then paste the code under it

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Registered User
    Join Date
    03-12-2013
    Location
    virgina
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Excel 2010 - Macro to join 5 rows with multiple cells to one row

    Thanks. It worked on my sample document so I will try it on the real spreadsheet at work in the morning.

    Have a great evening.
    Fiesty

  5. #5
    Registered User
    Join Date
    03-12-2013
    Location
    virgina
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Excel 2010 - Macro to join 5 rows with multiple cells to one row

    Harry, it worked on my sample spreadsheet - will try on the real spreadsheet tomorrow.

    Thanks so much for your help.
    have a great evening.
    Feisty

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Excel 2010 - Macro to join 5 rows with multiple cells to one row

    You're welcome - but, as Harry says, "try it once"

+ 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