0
votes

I need a simple twist to a common vba code that copy and paste columns/rows What I am trying to do is copy the entire row in sheet 2 , transpose and then paste them into Column A , Sheet1. The first row in sheet1 has the headings so I have to paste them into A2 that extends to the whole column

Sub transpose2()

Sheets(2).Range("A1", Cells(Columns.Count, "A").End(xlRight)).Copy
Sheets(1).Range("A2").PasteSpecial transpose:=True
Range("A1").ClearOutline

End Sub

This doesn't seem to work. Can anyone help me with this? Thank you!

1

1 Answers

1
votes
Sub transpose2()

    With Sheets(2)
        .Range(.Range("A1"), .Cells(1, .Columns.Count).End(xlToLeft)).Copy
    End With
    Sheets(1).Range("A2").PasteSpecial transpose:=True
    Range("A1").ClearOutline 'which sheet?

End Sub