• 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.

Copy Column and paste to last blank ..

Hi Ninjas,

Need some help with the data that I get from a clients site. I get the data in horizontal format, which has 2 colums of data for each person .. if possible, can a macro command copy the data for every 2 columns and paste it to the last blank of the previous column until all the data has been copied? say for example, my data runs from column A-Z, column C&D will be cut and pasted under the data of col A&B .. and continously done until all tha data are under column A&B? so that I can put the other computations on the right side .. thanks in advance guys!ü
 
Sub Cpy()
Dim i As Long
Application.ScreenUpdating = False
Sheets("Raw").Copy after:=Sheets(Sheets.Count)
Do While Sheets("Raw").Range("a1") <> ""
i = Sheets("Raw").Range("a" & Rows.Count).End(xlUp).Row
Sheets("Raw").Range("a1:b" & i).Copy
j = Sheet2.Range("a" & Rows.Count).End(xlUp).Row + 1
Sheet2.Range("a" & j).PasteSpecial
Sheets("Raw").Range("a1,b1").EntireColumn.Delete
Loop
Application.DisplayAlerts = False
Sheets("Raw").Delete
Sheets("Raw (2)").Name = "Raw"
Sheet2.Select
Sheet2.Rows(1).Delete

End Sub
 

Hi !

Try this demonstration (mods directly Sheet1) :​
Code:
Sub Demo()
    Application.ScreenUpdating = False
  
    With Sheet1
        With .Cells(1).CurrentRegion
            CC& = .Columns.Count
            RC& = .Rows.Count
        End With

        For C& = 3 To CC Step 2
            .Cells(C).Resize(RC, 2).Cut .Cells(1).End(xlDown)(2)
        Next
    End With
End Sub
Do you like it ? So thanks to click on bottom right Like !

_____________________________________________
Je suis Charlie
 
Back
Top