+ Reply to Thread
Results 1 to 5 of 5

Split Cell Data to New Rows & Copy Cells Containing Other Data to New Rows

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    10

    Split Cell Data to New Rows & Copy Cells Containing Other Data to New Rows

    Hello everyone,

    I do have a problem with splitting cell data to new rows and then copying other cells that contain other data to the new rows. The solutions given in a number of similar threads do not work for me. So when I tried to modify the macro from the thread below I got the message that "subscript out of range". I am unfamiliar with VBA. I tried unsuccessfully to modify the macro in this thread, which is very similar to what I'm dealing with:

    http://www.excelforum.com/showthread...ell+split+rows

    You see, I have exact same type of table as in the thread above with the exception that data in the cells is separated by semicolons. I'd like to split cell data in column E to new rows and then copy data from other cells (unchanged) in colums A through D to the new rows. I'm sure this is something rather simple for an experienced VBA user, but well beyond me.

    Could anyone please help? I have attached an excel sheet as a sample of the problem. Thanks!
    Attached Files Attached Files
    Last edited by ex2012; 01-20-2017 at 09:03 AM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Split Cell Data to New Rows & Copy Cells Containing Other Data to New Rows

    Hi,

    It's not at all clear (at least to me) what it is you're trying to achieve. In any case this is clearly a much simplified example and probably doesn't represent the size of your actual data. We often find that when we give an answer to what is a trivial non representative example when the solution is used with the real world data it doesn't work because of factors like string length and other stuff which is important but hasn't been mentioned.

    Therefore upload your real workbook (or at least a cut down copy), containing real words and manually add the results you expect to see. Clearly identify which is original data and which are the results and in a note clearly explain how you have arrived at your results.

    For instance but not exclusively what rule determines that Company B has the number of word split as 1, 1 & 2, 1 & 2 & 3, 4, 5, 6 & 7 & 8, 9

    What rule determines the spacing of the Company A words

    Incidentally, would you change your location to something sensible. It often helps if we need to consider your time zone, regional settings, list separators, currency...etc.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Split Cell Data to New Rows & Copy Cells Containing Other Data to New Rows

    I modified the char(10) to char(59) and added a title row to your sample data. The title row starts in A1 and the data actually starts in A2. Right click the page tab, click on View Code and copy this code and paste into the module presented. On the Developer tab click on Macros and choose "SplitltEnter2" and click on Run.
    Please Login or Register  to view this content.
    This code is taken directly from the link that you provided with char(10) changed to char(59).

    Here is your worksheet after the macro has been run. The macro should be included (I hope).
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Split Cell Data to New Rows & Copy Cells Containing Other Data to New Rows

    Here's another way

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  5. #5
    Registered User
    Join Date
    07-16-2012
    Location
    Poland
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Split Cell Data to New Rows & Copy Cells Containing Other Data to New Rows

    Guys, you absolutely rock. Your macros worked like a charm even though you worked on a non-representative data.

    Richard, I admit that real data is always best, but it's just impossible. I'm sure you understand.
    PS. Sorry for not responding earlier. I get the message that "Firefox has detected that the server is redirecting the request for this address in a way that will never complete", and "Sucuri CloudProxy - Backend Server timeout", and "The database has encountered a problem.". This under firefox and chrome. I haven't tried other browsers.

    This has been solved! Thank y'all!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] VBA Split Cell Contents to New Rows & Copy Cells containing single values to the new rows
    By jaimelwilson in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-14-2017, 05:30 PM
  2. [SOLVED] split cell contents into rows, and copy adjacent cells down
    By FDibbins in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-15-2016, 12:02 AM
  3. [SOLVED] Macro to split a single cell data into rows and copying other cells
    By CVARGA66 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-10-2012, 04:29 PM
  4. Macro to split a cell data into rows and copying other cells as it is in rows
    By shaan65 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-26-2010, 12:45 AM
  5. Split cell data into multiple new rows and copy other column values
    By jooga in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-01-2010, 02:30 AM
  6. Macro to split cell data into rows and copying other cells
    By stealthman in forum Excel General
    Replies: 4
    Last Post: 08-26-2010, 07:52 PM
  7. Macro to split a single cell data into rows and copying other cells as it is in rows
    By Pankaj Sonawane in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-25-2010, 07:09 PM

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