Transpose data in column to row through vba?

batman7570

New Member
Joined
Sep 10, 2016
Messages
8
dear all,

i would like to know if there is any solution to covert those data from multi column to row?
as following?

aaaaaa
aaaaaa
a
a
a
a
a
a
a
a
a
a
a
a

yours Truly,

<tbody>
</tbody>
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
The code will transpose a range (rows and columns) of cells to a single column on sheet2.
Code:
[COLOR="Navy"]Sub[/COLOR] MG04Jun20
[COLOR="Navy"]Dim[/COLOR] n [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long,[/COLOR] ray [COLOR="Navy"]As[/COLOR] Variant, c [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
ray = Range("a1").CurrentRegion
c = 1
    [COLOR="Navy"]For[/COLOR] n = 1 To UBound(ray)
         Sheets("Sheet2").Cells(c, 1).Resize(UBound(ray, 2)).Value = _
         Application.Transpose(Application.Index(ray, n))
         c = c + UBound(ray, 2)
    [COLOR="Navy"]Next[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Forum statistics

Threads
1,215,978
Messages
6,128,057
Members
449,416
Latest member
SHIVANISHARMA1711

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