Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts

    split into multiple rows (2003)

    Attached is a screen shot of what I need help with. I want to split column C so that each line is on its own row, with the data in columns A and B reapeating for each line.
    Attached Images Attached Images

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: split into multiple rows (2003)

    Do you mean column E instead of column C? If not, I don't understand your question.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: split into multiple rows (2003)

    Yes, that's right. Typo.. and to think I even did a preview before I posted it. Thanks!!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: split into multiple rows (2003)

    Try this macro:

    Sub SplitLines()
    Dim m As Long
    Dim r As Long
    Dim arr As Variant
    Dim i As Long
    m = Range("E" & Rows.Count).End(xlUp).Row
    For r = m To 1 Step -1
    arr = Split(Range("E" & r), vbLf)
    For i = UBound(arr) To 1 Step -1
    Range("A" & r).EntireRow.Copy
    Range("A" & (r + 1)).Insert
    Range("E" & (r + 1)) = arr(i)
    Next i
    Range("E" & r) = arr(0)
    Next r
    Application.CutCopyMode = False
    End Sub

  5. #5
    Star Lounger
    Join Date
    Jul 2005
    Location
    Jakarta, Indonesia
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: split into multiple rows (2003)

    It is great Hans, Melanie, I add in to my makro collection

  6. #6
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Ephrata, Washington, USA
    Posts
    683
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: split into multiple rows (2003)

    Yes! It works spectacularly! Thank you!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •