+ Reply to Thread
Results 1 to 3 of 3

transpose macro

Hybrid View

oeldere transpose macro 08-05-2012, 08:52 PM
rylo Re: transpose macro 08-05-2012, 09:11 PM
oeldere Re: transpose macro 08-05-2012, 09:21 PM
  1. #1
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: transpose macro

    Hi

    Here goes

    Sub aaa()
      Dim OutSH As Worksheet
      Set OutSH = Sheets("Blad2")
      OutSH.Range("A1:C1").Value = Array("Name", "Date", "Amount")
      
      For coll = 2 To Cells(3, Columns.Count).End(xlToLeft).Column
        For roww = 4 To Cells(Rows.Count, 1).End(xlUp).Row
          outrow = OutSH.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
          OutSH.Cells(outrow, 1) = Cells(roww, 1)
          OutSH.Cells(outrow, 2) = Cells(3, coll)
          OutSH.Cells(outrow, 3) = Cells(roww, coll)
        Next roww
      Next coll
      With OutSH
        .Range("A:C").Sort key1:=.Range("B1"), key2:=.Range("A1"), Header:=xlYes
        .Range("B2:B" & .Cells(Rows.Count, 2).End(xlUp).Row).NumberFormat = "mm-dd-yy"
      End With
        
      
    End Sub
    rylo

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: transpose macro

    @Rylo,

    I tested it and it works Perfect.

    Thanks a lot, and also thanks for the quick reply.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

+ 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