Forum Discussion
ADGToreUp
Apr 15, 2022Brass Contributor
PasteSpecial transpose:=True not working.
The code below keeps throwing an error: "Run-time error '1004': pasteSpecial method of Range class failed." I am not sure why it is throwing this error. I am setting up an application so that a use...
- Apr 15, 2022
By default, PasteSpecial performs a full paste. But you cannot transpose a table complete with its structure. You can paste the values and formatting:
Private Sub testTranspose() ThisWorkbook.Worksheets("Admin").ListObjects("OrgD").Range.Copy ThisWorkbook.Worksheets("Sheet1").Range("C26").PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Transpose:=True End Sub
HansVogelaar
Apr 15, 2022MVP
By default, PasteSpecial performs a full paste. But you cannot transpose a table complete with its structure. You can paste the values and formatting:
Private Sub testTranspose()
ThisWorkbook.Worksheets("Admin").ListObjects("OrgD").Range.Copy
ThisWorkbook.Worksheets("Sheet1").Range("C26").PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Transpose:=True
End Sub
ADGToreUp
Apr 15, 2022Brass Contributor
This worked great! Thank you, I really appreciate your help!