
Then click OK, and select one cell where you want to put the result in another popped out box, see screenshot:ĥ. After pasting the code, please press F5 key to run it, and a prompt box will pop out to remind you select the column that you want to transpose, see screenshot:Ĥ. XOutRg.Offset(xNRow, 0).PasteSpecial Paste:=xlPasteAll, Transpose:=Trueģ.

Set xOutRg = Application.InputBox("please select output range(specify one cell):", "Kutools for Excel", xTxt,, ,, , 8) MsgBox "the used range only contain one column",, "Kutools for Excel"

Set xRg = Application.InputBox("Please select data range(only one column):", "Kutools for Excel", xTxt,, ,, , 8)

VBA code: Transpose every 5 or n rows from one column to multiple columns: Public Sub TransposeData() Click Insert > Module, and paste the following code in the Module Window. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.Ģ. If you can't apply the formula correctly, the following VBA code also can help you.ġ. Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. Then drag the fill handle right to five cells, and go on dragging the fill handle down to the range of cells until displays 0, see screenshot: And the first cell of the list must be located at the first row in the worksheet.Ģ. Note: In the above formula, A:A is the column reference that you want to transpose, and A1 is the first cell of the used column, the number 5 indicates the number of columns that your data will locate, you can change them to your need. Enter the following formula into a blank cell where you want to put the result, C1, for example, =INDEX($A:$A,ROW(A1)*5-5+COLUMN(A1)), see screenshot: In Excel, you can apply the following formula to transpose every n rows from one column to multiple columns, please do as follows:ġ. Transpose every 5 or n rows from one column to multiple columns with Kutools for Excel Transpose every 5 or n rows from one column to multiple columns with VBA code Transpose every 5 or n rows from one column to multiple columns with formula

How could you deal with this task without copying and pasting repeatedly in Excel? Supposing, you have long data in column A, and now, you want to transpose every 5 rows from column A to multiple columns, such as transpose A1:A5 to C6:G6, A6:A10 to C7:G7, and so on as following screenshot shown.
