ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Copy then Paste with a transpose (https://www.excelbanter.com/excel-discussion-misc-queries/167786-copy-then-paste-transpose.html)

stevem

Copy then Paste with a transpose
 
In a macro, I am trying to transfer the values from a vertical named range to
a horizontal named range as described in the following example,

Test_Horizontal represents B2,B3,B4
Test_Vertical represents A1,A2,A3

Range("Test_Horizontal").Value = Range("Test_Vertical").Value

This however is not working. If both named ranges were vertical, the above
code will work.

Does anyone know how to do this without a copy and paste special
transpose?...or is this the most efficient way to do it.

Thank you




Dave Peterson

Copy then Paste with a transpose
 
Range("Test_Horizontal").Value _
= Application.Transpose(Range("Test_Vertical").Value )

SteveM wrote:

In a macro, I am trying to transfer the values from a vertical named range to
a horizontal named range as described in the following example,

Test_Horizontal represents B2,B3,B4
Test_Vertical represents A1,A2,A3

Range("Test_Horizontal").Value = Range("Test_Vertical").Value

This however is not working. If both named ranges were vertical, the above
code will work.

Does anyone know how to do this without a copy and paste special
transpose?...or is this the most efficient way to do it.

Thank you


--

Dave Peterson

stevem

Copy then Paste with a transpose
 
Works perfectly. Thank You

"Dave Peterson" wrote:

Range("Test_Horizontal").Value _
= Application.Transpose(Range("Test_Vertical").Value )

SteveM wrote:

In a macro, I am trying to transfer the values from a vertical named range to
a horizontal named range as described in the following example,

Test_Horizontal represents B2,B3,B4
Test_Vertical represents A1,A2,A3

Range("Test_Horizontal").Value = Range("Test_Vertical").Value

This however is not working. If both named ranges were vertical, the above
code will work.

Does anyone know how to do this without a copy and paste special
transpose?...or is this the most efficient way to do it.

Thank you


--

Dave Peterson



All times are GMT +1. The time now is 11:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com