Search code examples
exceltransposevba

Excel VBA - Range.Copy transpose paste


I am following the help menu for PasteSpecial but I cannot seem to get my code to work without an error.

I want to take Worksheets("Sheet1").Range("A1","A5") and paste transpose to Worksheets("Sheet2").Range("A1","E1").

What is the most simple way to accomplish this?


Solution

  • Worksheets("Sheet1").Range("A1:A5").Copy
    Worksheets("Sheet2").Range("A1").PasteSpecial Transpose:=True