Попробуйте эту формулу:
=IFERROR(INDEX($A$1:$C$4,MOD(ROW()-1,4)+1,INT((ROW()-1)/4)+1),"")
и перетащить/скопировать вниз, обязательный.
VBA Решение:
Sub RowsToColumn()
Dim dict As Object
Dim lastRow As Long, lastColumn As Long, cnt As Long
Dim myRng As Range
Set dict = CreateObject("Scripting.Dictionary")
'get last row and column with data
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
lastColumn = Cells(1, Columns.Count).End(xlToLeft).Column
'set your range here
'Set myRng = Range("A1:C4")
Set myRng = Range(Cells(1, 1), Cells(lastRow, lastColumn))
cnt = 1
'put cell value in dictionary
For Each col In myRng.Columns
For Each cel In col.Cells
dict.Add cel.Value, cnt
cnt = cnt + 1
Next cel
Next col
'display values in dictionary
Range("E1").Resize(dict.Count) = Application.Transpose(dict.keys)
End Sub
Вы можете разместить код, который вы уже пробовали и описать то, что вы пытаетесь для того чтобы достигнуть лучше или, возможно, загрузить фотографию своего начала ситуации и результат в качестве примера? –
Дубликат: https://stackoverflow.com/questions/38232626/using-vlookup-macros-to-transpose/38232974#38232974 –