Excel vba transpose one column to multiple column

mkara

New Member
Joined
Aug 31, 2023
Messages
3
Office Version
  1. 365
  2. 2021
  3. 2019
Platform
  1. Windows
Hi guys I want to transpose one column into different 13 columns but I don't know how to write the code. Can you help me? It should be like this:
A
B ----> A B C D ....
C
D
.
.
.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
In O365 you have the funxtion TOROW()
Or just TRANSPOSE()
 
Upvote 0
Hi guys I want to transpose one column into different 13 columns but I don't know how to write the code. Can you help me? It should be like this:
A
B ----> A B C D ....
C
D
.
.
.
transpose doesn't give the same result that i want, i want a result something like this basicly, i've looked the similar questions and wrote a code like in the that:
Sub transpose()

xRow = Selection.Rows.Count
xCol = Selection.Column

nextRow = 1

' how many rows to transpose
stepValue = 13

For i = 1 To xRow Step stepValue

Cells(i, xCol).Resize(stepValue).Copy
Cells(1, xCol).Offset(nextRow, 2).PasteSpecial Paste:=xlPasteA

nextRow = nextRow + 1

Next

End Sub

but it says "pastespecial of range class method fails" i am so confused
1693478019575.png
 
Upvote 0
You can use a formula for that
Fluff.xlsm
ABCDEFGHIJKLMNO
11
2212345678910111213
3314151617181920212223242526
4427282930
55
66
77
88
99
1010
1111
1212
1313
1414
1515
1616
1717
1818
1919
2020
2121
2222
2323
2424
2525
2626
2727
2828
2929
3030
31
32
33
Data
Cell Formulas
RangeFormula
C2:O4C2=WRAPROWS(TOCOL(A1:A100,1),13,"")
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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