Hello,
this the code doesn't work i would transpose as what in existed in picture the result from e: h i hope somebody help me
Sub VerticalToHorizontal()
Dim a As Variant, b As Variant
Dim RowsPerBlock As Long, NumBlocks As Long, i As Long, j As Long, BaseNum As Long
RowsPerBlock = Columns(1).Find(What:=Range("A1").Value, LookAt:=xlWhole).Row - 1
'*** RowsPerBlock will =1 if A1 is empty or
'*** it will = 0 if A1 is the only cell in the column with data
If RowsPerBlock = 0 Or Range("A1") = "" Then
Exit Sub
End If
a = Range("B1:C" & Range("A" & Rows.Count).End(xlUp).Row).Value
NumBlocks = UBound(a) / RowsPerBlock
ReDim b(1 To NumBlocks, 1 To RowsPerBlock)
Do Until i = NumBlocks
i = i + 1
BaseNum = (i - 1) * RowsPerBlock
For j = 1 To RowsPerBlock
b(i, j) = a(BaseNum + j, 1)
Next j
Loop
With Range("e1").Resize(, RowsPerBlock)
.Value = Application.Transpose(Range("A1").Resize(RowsPerBlock).Value)
.Offset(1).Resize(NumBlocks).Value = b
End With
End Sub
first of all this code is not original it was existed error somebody try fix the error by this RowsPerBlock always be 0
it doesn't solve my problem the secondly i don't mind if is solve my problem your code is nice but i think you should fix as my image in column e it supposes doesn't show and i would dynamically transpose data maybe i have many brands i'm talking about from col a,b maybe data also in col c,d,e..etc