excel sorting row wise with VB Code[RESOLVED]
Hi
My excel worksheet contains data like this
A B X A U X A U
11 22 33 44 55 66 77 88
12 13 14 15 16 17 18 19
I want to sort the whole data row wise and to be shown as follows
A A A B U U X X
11 44 77 22 55 88 33 66
12 15 18 13 16 19 14 17
means i have to sort the block of data based on the coloumn header.
I'm not familiar with the VBA codes so please help me.
Thanks in advance
3 Attachment(s)
Re: excel sorting row wise with VB Code
No VBA needed here. You can use the sort method but column sorted instead
of the defaullt row sort.
Step 1. Click Data > Sort... > then click Options... button.
http://www.vbforums.com/attachment.p...chmentid=32826
Step 2. Change the sorting to "Sort left to right."
http://www.vbforums.com/attachment.p...chmentid=32827
Step 3. Change the Sort By to "Row 1".
http://www.vbforums.com/attachment.p...chmentid=32828
Done!
Code:
Results:
A A A B U U X X
11 44 77 22 55 88 33 66
12 15 18 13 16 19 14 17
HTH
Re: excel sorting row wise with VB Code
Thank you very much Mr.Rob. You saved my time!.
Thanks again
-afterMoon-
Re: excel sorting row wise with VB Code[RESOLVED]
No prob. Glad to help. :thumb: