Transpose from multiple column

Vishaal

Well-known Member
Joined
Mar 16, 2019
Messages
543
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
  2. Web
Hi, we want to transpose some data from multiple column, is there any option to do it

Query Table
CodeAmountQty
123456789101234567891012345678910
80780882479381210911316526610111211
8081131
SD-DE-1685380812590113242
8661651


Result Table
CodeQtyAmount
8071109
8081113
8242165
7931266
8121101
8081113
SD-DE-162125
853490
8082113
8661165
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
try this on a copy of your file.
this will copy the data out into columns BA: thru BC

VBA Code:
Sub Do_it()

wr = 2
For r = 3 To Cells(Rows.Count, "A").End(xlUp).Row
    For c = 1 To 10
    
    code = Cells(r, c)
        If code = "" Then GoTo 222 'last code reach jump to next row
    amt = Cells(r, c + 11)
    qty = Cells(r, c + 22)
   
    Cells(wr, "BA") = code
    Cells(wr, "BB") = qty
    Cells(wr, "BC") = amt
    
    wr = wr + 1
    
    Next c
222 Next r

End Sub

hth,
Ross
 
Upvote 1
Solution

Forum statistics

Threads
1,223,630
Messages
6,173,454
Members
452,514
Latest member
cjkelly15

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