Try this: https://www.extendoffice.com/documents/excel/4233-excel-stack-columns.html.
=INDEX(MyData,1+INT((ROW(A1)-1)/COLUMNS(MyData)),MOD(ROW(A1)-1+COLUMNS(MyData),COLUMNS(MyData))+1)
, where mydata is the range you have to insert in the column.
If you don't want to use the formula, try vba:
Function ToColumn(rng As range) As Variant
Dim arr
Dim cel As range
Dim str As String
For Each cel In rng
If Len(cel) > 0 Then
If str = "" Then
str = cel
Else
str = str & "," & cel
End If
End If
Next cel
arr = Split(str, ",")
ToColumn = Application.Transpose(arr)
End Function
How to use this function:
First select the range (example F1:F5) you think will fit your data, then select your range (A1:D2) you want to import in your column and type =IFERROR(ToColumn(D1:CY500),"")
and press Ctrl+Shift+Enter.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…