VBA Past Transpose without using select

Skyhawk32806

New Member
Joined
May 8, 2010
Messages
26
Hi,

I'm working on a macro where I have to paste a range of data using transpose. It there an easy way to paste the data without using select? I know how to do it if I don't have Transpose...

My current code:
Code:
Sheet2.Range("D2:CU2:).Copy
Sheet3.Range("F2").PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=True

There is a lot more going inbetween the 2 lines, I just wanted to make it easier to read.

Thanks for any ideas :)
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
The code you posted will work fine, it doesn't select anything.
Except of coarse for your little typo...

Sheet2.Range("D2:CU2:).Copy
should be
Sheet2.Range("D2:CU2").Copy
 
Upvote 0
Oh I actually typed it wrong, my initial code had select in. I didn't realize my incorrect code would actually work. :eeek:
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
Thanks!
 
Upvote 0
You may try sth like this as well:
Code:
Dim R As Range

Arr = Sheet2.Range("D2:CU2").Value
Arr = WorksheetFunction.Transpose(Arr)

Set R = Sheet3.Range("F2").Resize(UBound(Arr, 1) - LBound(Arr, 1) + 1, 1)
R = Arr
 
Upvote 0
You may try sth like this as well:
Code:
Dim R As Range
 
Arr = Sheet2.Range("D2:CU2").Value
Arr = WorksheetFunction.Transpose(Arr)
 
Set R = Sheet3.Range("F2").Resize(UBound(Arr, 1) - LBound(Arr, 1) + 1, 1)
R = Arr

Great, thanks for that idea also!
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,337
Members
452,907
Latest member
Roland Deschain

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