I wrote this code, but it only works when sheet1 is active. If sheet2 is active and I run the code, there is 1004 error. I don't know why. Thank you in advance!
Public Sub trans()
Worksheets("Sheet1").Range(Cells(1, 1), Cells(3, 2)).Copy
Worksheets("Sheet2").Range("A1").PasteSpecial Transpose:=True
End Sub