Link to home
Start Free TrialLog in
Avatar of drtopserv
drtopservFlag for Israel

asked on

transpose columns to rows

Hi,
I would like to do this programatically :
I have this sheet1:

ID  CODE1   CODE2  
1        111         222      
2        666          67        
3         321       234    

I would like to run code/function/macro whatever to be able to have the result:

ID  
1   CODE1  111
1   CODE2  222
2   CODE1  666
2   CODE2  67
3   CODE1  321
3   CODE2  234
Avatar of Professor J
Professor J

you can easily do this with free Add-in Power Query

see the tutorial
Have you tried Paste>Transpose?
Avatar of drtopserv

ASKER

appretiate another solution becuase i can`t install power-query at this time , my computer don`t have explorer 9 .
Paste>Transpose? will do :
ID  CODE1   CODE2  
1        111         222      
 2        666          67        
 3         321       234    

ID           1        2          3
CODE1  111    666      321
CODE2   222   67         234
ASKER CERTIFIED SOLUTION
Avatar of Professor J
Professor J

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Without code

If your given data starts from A1 on sheet1 then use this formula on A2 Sheet2 and copy it down and across

=INDEX(Sheet1!$1:$1048576,IF(COLUMN()=2,1,(ROW()+2)/2),IF(COLUMN()=1,1,IF(MOD(ROW(),2),3,2)))
BEST OF THE BEST.
THANKS ALOTTT
WORKS AS A CHARM!
you are welcome. i am glad i was able to help.