Macro for paste values and transpose

straggleyway

New Member
Joined
Mar 1, 2009
Messages
5
Hi all,

This is driving me crazy. Really grateful for help. I want to make a macro that I can copy a column of numbers, select a cell... then run the macro - which will transpose them and paste the values.


I've tried to make this by Recorder... but I keep getting an error.

Run-time error 1004
Paste-Special method of Range class failed.

I've seen other people in the past post this questions, but it seems noone has solved it!

Any ideas? Code below....

Thank you!!


Sub Transpose()
'
' Transpose Macro
' Macro recorded 11/03/2009
'
'
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
End Sub
 
You can't transpose a selection where the destination range will include anything in the orignal source range.

Try this in Excel.

1 Enter some data in column A.

2 Select it.

3 Goto Edit>Paste special and click Transpose and then OK.

You'll get an error.
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
If you just want to Transpose what you have in the clipboard to the active cell, this will do that:
Code:
Sub Transpose()
    ActiveCell.PasteSpecial Paste:=xlPasteValues, Transpose:=True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,917
Messages
6,122,233
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top