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

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
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,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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