vba - Transpose without clipboard

Joeybagadonuts

New Member
Joined
Nov 3, 2005
Messages
8
I basically want to copy paste values and formats, tranposed. Without using the clipboard.

Is there a way using something like the Copy Destination:= or something like that.

Thanks for any help.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Can you give some more information?

Are you doing this in code?
 
Upvote 0
Yeah, instead of something like this:

Range("I8:I91").Copy
Windows("temp.txt").Activate
Cells(age - 2, 1).PasteSpecial Paste:=xlValues, Transpose:=True
Cells(age - 2, 1).PasteSpecial Paste:=xlFormats, Transpose:=True: Application.CutCopyMode = False

I know there is a method of skipping the clipboard to copy - paste...like this:


Sheet1.Range("A1:A200").Copy Destination:=Sheet2.Range("B1")


But how to paste and transpose without the clipboard?
 
Upvote 0
I'm sorry but I just don't think you can.

I suppose you could write code that copied and pasted each cell with the transpose. But that kind of defeats the point.
 
Upvote 0
Joey

You could use the Transpose worksheet function.
Code:
Range("A1:E1") = WorksheetFunction.Transpose(Range("A3:A7"))
I'm not quite sure how you would implement that in your code and I'm not sure if it would have any impact on performance.
 
Upvote 0
Sub myTrans()
Dim mySel As Range, myPst As Range
Dim myCR&, myCC&, myPR&, myPC&

Set mySel = Application.InputBox(prompt:="Select Copy Range:", Type:=8)
myCC = mySel.Columns.Count
myCR = mySel.Rows.Count

Set myPst = Application.InputBox(prompt:="Select Paste Range:", Type:=8)
myPC = myPst.Columns.Count
myPR = myPst.Rows.Count

If (myCC <> myPR Or myCR <> myPC) Then _
MsgBox "Your Paste Range must be the same size as your Copy Range size!": GoTo myEnd:

Range(myPst.Address) = WorksheetFunction.Transpose(Range(mySel.Address))

myEnd:
End Sub
 
Upvote 0

Forum statistics

Threads
1,207,256
Messages
6,077,321
Members
446,278
Latest member
hoangquan2310

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