VBA code to use Tranpose from on worksheet to an other

amxtomzo

Active Member
Joined
Nov 7, 2009
Messages
302
Hello, thanks for taking the time to help me out....

Sub Xpose()
Worksheets("insertion_order").Select
' copy column E info into Row 6 starting at column C in worsheet "zone_chart"

Range("A12").Resize(, 10).Value = Application.Transpose(Range("C6:L6"))
End Sub

I would like to modify this code to transpose on to an other worksheet

i have about 65 columns need to to this to
column E needs to go to row 6 in work sheet "zone chart"
Column F needs to go to row 7 in work sheet "zone chart"
so forth and so on.....

Thanks

Thomas
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

JLGWhiz

Well-known Member
Joined
Feb 7, 2012
Messages
11,931
Office Version
2013
Platform
Windows
Hi Thomas,
I can get the column E and column F part, but I don't know how to code the so forth and so on.
I am going to assume you want all columns copied and transposed to the second sheet.
Code:
Sub Xpose2()
Dim sh1 As Worksheet, sh2 As Worksheet, lc As Long
Set sh1 = Sheets(1) 'Edit sheet name
Set sh2 = Sheets(2) 'Edit sheet name
lc = sh1.Cells(2, Columns.Count).End(xlToLeft).Column
    For i = 5 To lc
        If Application.CountA(sh1.Columns(i)) <> 0 Then
        sh1.Range(sh1.Cells(2, i), sh1.Cells(Rows.Count, i).End(xlUp)).Copy
        sh2.Range("C" & i + 1).PasteSpecial Transpose:=True
        End If
    Next
Application.CutCopyMode = False
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,099,353
Messages
5,468,118
Members
406,567
Latest member
ultrasuede

This Week's Hot Topics

Top