+ Reply to Thread
Results 1 to 2 of 2

Transpose data from rows to columns - with a slight twist

Hybrid View

  1. #1
    Registered User
    Join Date
    09-21-2012
    Location
    Seattle
    MS-Off Ver
    Excel 2010
    Posts
    1

    Transpose data from rows to columns - with a slight twist

    I have a list with data in one column, the number of rows is in the thousands. I need to transpose this list into a new list with 3 columns (data in the same sequence as the source). Attached is my example with Source and Target tabs.
    Attached Files Attached Files

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

    Re: Transpose data from rows to columns - with a slight twist

    this will work

    Sub abc()
     Const shSource As String = "Source"  '<==== Change for your needs
     Const shTarget As String = "Target"  '<==== Change for your needs
     
     Dim CellPtr As Long, DestRow As Long
     
     DestRow = 1
     With Worksheets(shSource)
        For CellPtr = 1 To .Cells(Rows.Count, "a").End(xlUp).Row Step 3
           a = .Range(.Cells(CellPtr, "a"), .Cells(CellPtr + 2, "a"))
           With Worksheets(shTarget)
                .Cells(DestRow, "a").Resize(, UBound(a)) = Application.Transpose(a)
           End With
           DestRow = DestRow + 1
        Next
     End With
    End Sub
    Thanks,
    Mike

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

+ 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