Transpose Macro

levanoj

Active Member
Joined
Oct 25, 2007
Messages
311
I need macro than can basically transpose the Sheet1 on my workbook onto Sheet2 as shown below:

Book1
ABCDEF
1LineIDUserIDUserIDUserIDUserIDUserID
210241302134213431399
3102513731374137513761399
41030
5103113731374
61032
71033
8103413731374
Sheet1


Book1
ABCD
1LineIDUserID
210241302
310241342
410241343
510241399
610251373
710251374
810251375
910251376
1010251399
111030
1210311373
1310311374
141032
151033
1610341373
1710341374
Sheet2


The columns and rows may vary depending on the file so the above is just an example.
 
Selection is assumed to be a regular 2 dimensional range on a single sheet, as in:

A1:B10

Make sure that range is highlighted, then run the macro.
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
It's probably because your sheets aren't Sheet1, Sheet2 in macro.

Try replacing all "Sheet1." with the name of your worksheet by using "Worksheets("Sheet1")."

and same thing with "Sheet2." with "Worksheets("Sheet2")"
 
Upvote 0

Forum statistics

Threads
1,224,574
Messages
6,179,626
Members
452,933
Latest member
patv

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