+ Reply to Thread
Results 1 to 8 of 8

Splitting data from a cell to multiple rows

  1. #1
    Registered User
    Join Date
    04-26-2009
    Location
    Riyadh
    MS-Off Ver
    Excel 2003
    Posts
    4

    Splitting data from a cell to multiple rows

    Dear All,

    Faced with a problem. I have steps for doing testing in one cell but I need to put them in multiple rows.

    Example
    A B C D
    1Test Case Name Description Step Expected Result
    2 To check user add user check Step 1: Open Sys User added
    Step 2: Login admin
    Step 3: Add user
    Step 4: Logoff

    3 To check user del user deletion Step 1: .... User Deleted

    Basically in Cell C2 all the steps have been written with carriage returns (Alt + Enter).

    The logical sequence that I want is : -
    a) Cursor moves to the column
    b) Counts the number of sub steps and reduces one from it
    c) inserts Blank rows under that row one for each sub step
    d) Keeps the first row as it is
    e) pastes Step 2 onwards into C3, C4 onwards. No other data to be replicated

    Output required is

    A B C D
    1Test Case Name Description Step Expected Result
    2 To check user add user check Step 1: Open Sys User added
    3 Step 2: Login admin
    4 Step 3: Add user
    5 Step 4: Logoff

    6 To check user del user deletion Step 1: .... User Deleted


    Please note that C3, C4 & C5 now have the relevant steps

    I am ok for running the program for each such cell or one shot for all.

    Appreciate your help or any questions

    Mukul

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Splitting data from a cell to multiple rows

    mukul.saxena,

    Welcome to the Excel Forum.

    Please post your workbook with raw data, and a section to the right of the raw data in your new format.

    Scroll down and see "Manage Attachments".
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Registered User
    Join Date
    04-26-2009
    Location
    Riyadh
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Splitting data from a cell to multiple rows

    Hi,

    Realized that the formatting was lost. I am attaching an excel file with Input and output

    Mukul
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Splitting data from a cell to multiple rows

    Mukul,

    Your Input and Output areas are identical. And You mentioned 4 or 5 steps (not shown).

    Can we have another workbook, with about 5 samples of Input in columns A thru E, and the required Output in columns G thru K.

  5. #5
    Registered User
    Join Date
    04-26-2009
    Location
    Riyadh
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Splitting data from a cell to multiple rows

    Dear Stan,

    The Input and Output areas are not the same. Kindly note that in the Input aread D3 has 3 steps written in the same cell separated by carriage return. However, in output area all these steps are now pasted in different rows i.e., D11, D12 and D13.

    I am attaching a much bigger file for your ref.

    Mukul
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Splitting data from a cell to multiple rows

    Mukul,

    Does "Test Case Name" in cell A2, for "Input", actually start in cell A1, for your raw data?

  7. #7
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Splitting data from a cell to multiple rows

    Mukul,

    See the attached workbook "Split Carriage Return Data in rows - prob1(1) - mukul_saxena - SDG.xls" with macro "SplitData".

    I am using Sheet1 for your raw data, and Sheet2 as your "Output".

    Sheet1, cell A1 contains "Test Case Name", not "Input".

    Then run the "SplitData" macro.

  8. #8
    Registered User
    Join Date
    04-26-2009
    Location
    Riyadh
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Splitting data from a cell to multiple rows

    Dear Stan,

    Thanks for all the help. Problem resolved.

    Thanks
    Mukul

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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