+ Reply to Thread
Results 1 to 2 of 2

Transpose Macro

Hybrid View

dsavage Transpose Macro 11-10-2011, 11:46 AM
jaslake Re: Transpose Macro 11-10-2011, 03:46 PM
  1. #1
    Registered User
    Join Date
    11-09-2011
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2003
    Posts
    1

    Transpose Macro

    Hello,
    I'm looking for a macro to transpose multiple rows of hourly data to one continuous column. It requires a new transpose command at the hour 1 cell of each row. Attached is an example data file.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Transpose Macro

    Hi dsavage
    Try this code
    Option Explicit
    Sub Rows_To_Columns()
        Dim Rng As Range
        Dim lr As Long
        Dim AClr As Long
        Dim i As Long
        lr = Range("A" & Rows.Count).End(xlUp).Row
        Set Rng = Range("B3:B" & lr)
        For i = 1 To lr
            Rng(i).Resize(1, 24).Copy
            AClr = Range("AC" & Rows.Count).End(xlUp).Offset(1, 0).Row
            Range("AC" & AClr).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
                    False, Transpose:=True
            Application.CutCopyMode = False
        Next i
    End Sub
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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