Excel VBA - Range.Copy transpose paste

user1130306 picture user1130306 · Jan 13, 2012 · Viewed 143k times · Source

I'm trying to something very simple, but I seem to be stuck. 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?

Answer

GSerg picture GSerg · Jan 13, 2012
Worksheets("Sheet1").Range("A1:A5").Copy
Worksheets("Sheet2").Range("A1").PasteSpecial Transpose:=True