Copy a range, have it tranposed and inserted into another file in VBA


Posted by Chris on November 11, 2001 1:32 AM

I am trying to copy a range from one file to another, but in the new file I need it to be transposed. How do I do this in VBA?
I created a variable for the range, called the transpose function on it and then set the variable in a cell. The only thing I get in the cell is the first valeue of the first cell in the range I transposed. Any suggestions?



Posted by Ivan F Moala on November 11, 2001 11:49 PM

somehing along these lines may help;

Sub Trans()
Dim MyRange As Range

Set MyRange = Range("C4:E10")
MyRange.Copy
Windows("Book6").Activate
Range("A4").PasteSpecial Transpose:=True
Application.CutCopyMode = False
Set MyRange = Nothing

End Sub

Ivan