Divide rows into multiple rows if a cell has more than 1 "row"

  • I have an export file I get from a system that gives me sometimes values in cells that are in different rows within the cell.
    This give me a hard time to extract the data. So I would in in these cases like that the row gets divided into new rows.
    Been trying to sort it out without any luck.
    Attached is an examplefile of how the data can look and how I would like it to be.

  • Re: Divide rows into multiple rows if a cell has more than 1 "row"


    Can't download the sheet, at work waiting for some tests to run.


    Something like this should help you though:


    Code
    'Takes the input string and splits it into an array using a Line Feed as the delimiter
    Public Function SplitLineBreaks(ByRef strInput as String) As Variant
        SplitLineBreaks = Split(strInput, vbLf)
    End Function


    So you need to feed in the value from the cell as the strInput and it will return an array with a minimum size of 0 to 0, or 0 to X based on the number of line breaks found in the string, with each element representing the string from the start/line break to the next line break/end.

  • Re: Divide rows into multiple rows if a cell has more than 1 "row"


    Following on from TheGlovner's suggestion, try this. It puts the results on a new sheet

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!