Consulting

Results 1 to 3 of 3

Thread: Rows to Column (Transpose) with one Heading

  1. #1

    Rows to Column (Transpose) with one Heading

    Hi,

    Request your help in transposing the data (rows to column) with one common heading.

    I have attached herewith the sample data and required result in the file.

    kindly help me in this regard

    Regards,
    Satish Gubbi
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Public Sub RearrangeData()
    Dim lastrow As Long
    Dim i As Long
    
        With ActiveSheet
        
            lastrow = .Cells(.Rows.Count, "B").End(xlUp).Row
            For i = lastrow To 1 Step -4
            
                .Cells(i - 2, "B").Value = .Cells(i - 2, "C").Value
                .Cells(i - 2, "D").Value = .Cells(i, "C").Value
                .Cells(i - 2, "C").Value = .Cells(i - 1, "C").Value
                
                .Rows(i - 1).Resize(3).Delete
            Next i
            
            .Range("B1:D1") = Array("VAT 14.5%", "Net Product", "Sales")
            
            lastrow = .Cells(.Rows.Count, "B").End(xlUp).Row
            .Range("B2").Resize(lastrow - 1).NumberFormat = "#,##0.00"
        End With
    End Sub
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Thank you very much XLD, I will check the code and I will post the status.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •