• Excel Macro to move data from Rows to column

    From Greg Della-Croce@21:1/5 to All on Mon Jul 6 11:25:01 2020
    Can anyone here please point me in the right direction for moving a database that put all the data in one column like this

    Name
    Address
    City
    Zipcode
    Status

    There are about 8000 rows in the database. I need to recreate and report from this data. I need the data in columns like this:

    Name Address City Zipcode Status


    I would like to build a VBA to move all the data at once to a second tab on the workbook. Can/would anyone be willing to help me. I need to do this by Wednesday (7/8) so that I can get the reports out by Thursday.

    Thank you.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Claus Busch@21:1/5 to All on Mon Jul 6 20:41:55 2020
    Hi Greg,

    Am Mon, 6 Jul 2020 11:25:01 -0700 (PDT) schrieb Greg Della-Croce:

    Can anyone here please point me in the right direction for moving a database that put all the data in one column like this

    Name
    Address
    City
    Zipcode
    Status

    There are about 8000 rows in the database. I need to recreate and report from this data. I need the data in columns like this:

    Name Address City Zipcode Status

    I would like to build a VBA to move all the data at once to a second tab on the workbook. Can/would anyone be willing to help me. I need to do this by Wednesday (7/8) so that I can get the reports out by Thursday.

    try:

    Sub TransposeData()
    Dim LRow As Long, i As Long
    Dim n As Long
    Dim varData As Variant

    n = 1
    With Sheets("Sheet1")
    LRow = .Cells(.Rows.Count, "A").End(xlUp).Row
    For i = 1 To LRow Step 5
    varData = .Cells(i, "A").Resize(5)
    Sheets("Sheet2").Cells(n, 1).Resize(, 5).Value = _
    Application.Transpose(varData)
    n = n + 1
    Next
    End With
    End Sub


    Regards
    Claus B.
    --
    Windows10
    Office 2016

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)