• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Group Column data to row in VBA

coolkiran

Member
Hi

I have database everything in One row, i want to split into rows, i have attached the file. there are two sheets input and output, Input contains how i am getting the data. I want output is like Output sheet.

copy each 4 columns to new row.

Thanks in advance
 

Attachments

Check this..


Code:
Sub arrange_in_order()
Dim cols As Integer, i As Integer, j As Integer

col = Sheet1.Range("A1").CurrentRegion.Columns.Count
j = 1
For i = 1 To col Step 4
    Range(Cells(1, i), Cells(i, i + 3)).Copy Sheet2.Cells(j, 1)
    j = j + 1
Next
End Sub
 
Back
Top