Excel transpose

Hansraj

New Member
Joined
Jan 23, 2018
Messages
2
Hi Sir
I have mentioned below table:
ORDER_NO
Reason For Rejection
4532599
Allocation Stock

Mismatch Packing

Surplus

(blank)
4535662
(blank)
4535724
Unavailability of Stock
4535729
Allocation Stock

Unavailability of Stock

(blank)
4535738
Allocation Stock

Mismatch Packing

(blank)

<tbody>
</tbody>

And I want result as mention below:

ORDER_NO
Reason For Rejection
Reason For Rejection
Reason For Rejection
Reason For Rejection
4532599
Allocation Stock
Mismatch Packing
Surplus
(blank)
4535662
(blank)



4535724
Unavailability of Stock



4535729
Allocation Stock
Unavailability of Stock
(blank)

4535738
Allocation Stock
Mismatch Packing
(blank)


<tbody>
</tbody>


<tbody>
</tbody>

Thanks
Hansraj
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Try this

Code:
Sub TransTable()
Lastrow = Worksheets("Sheet1").Cells(Rows.Count, "B").End(xlUp).Row
j = ""
k = 0
For i = 2 To Lastrow
If Worksheets("Sheet1").Cells(i, 1) = "" Then
  l = j: m = m + 1
Else
  l = Worksheets("Sheet1").Cells(i, 1)
  m = 2
  k = k + 1
  Worksheets("Sheet2").Cells(k, 1) = l
End If
j = l
Worksheets("Sheet2").Cells(k, m) = Cells(i, 2)
Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,896
Members
449,194
Latest member
JayEggleton

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