Results 1 to 3 of 3

Multiple rows to single rows

Threaded View

qiyusi Multiple rows to single rows 03-14-2017, 06:29 AM
Marc L Re: Multiple rows to single... 03-14-2017, 06:41 AM
mike7952 Re: Multiple rows to single... 03-14-2017, 03:11 PM
  1. #1
    Forum Contributor
    Join Date
    10-22-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    177

    Multiple rows to single rows

    Hello

    I have questions,

    I have code to transpose multiple rows into single rows, it not 100% work,

    Sub splitthem()
    Dim Rng As Range, Dn As Range, ray(), Txt As String, t
    Set Rng = Range(Range("A3"), Range("A" & Rows.Count).End(xlUp))
    For Each Dn In Rng
        If Not temp = Dn And Dn <> "" Then
            Set temp = Dn
            c = c + 1
        End If
        ReDim Preserve ray(1 To 2, 1 To c)
        ray(1, c) = temp: ray(2, c) = ray(2, c) & " " & Dn.Offset(, 1).Value
    Next Dn
    Range("G1").Resize(c, 2) = Application.Transpose(ray)
    End Sub
    as there are at least two problem:
    1. the result is in single cell separate by comma, i need the result in separate column
    2. the last data not show properly, in example, the letter G is not show up.

    Would be great if you can review what's wrong with the code.

    sample file attached.

    Thank you for the help.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 04-06-2016, 07:02 AM
  2. Replies: 9
    Last Post: 11-11-2015, 08:19 PM
  3. Replies: 5
    Last Post: 05-25-2013, 07:12 AM
  4. Multiple Rows to Single Rows, Macro?
    By jetta1 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-06-2013, 05:33 PM
  5. [SOLVED] Importing CSV file into single column/multiple rows vs. multiple rows/single column
    By bjorgenson@charter.net in forum Excel General
    Replies: 4
    Last Post: 07-03-2012, 08:01 PM
  6. Combining Multiple Rows in to Single Rows
    By Pickle29 in forum Excel General
    Replies: 2
    Last Post: 12-07-2011, 01:05 PM
  7. Replies: 1
    Last Post: 03-18-2009, 04:18 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