Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort Columns


Hi,

I have 5 columns with 5000 rows.
Column Headings a
C1, C2, Account, Amount, Type

I need to write a macro which will sort data by Column to:
Account, Type, Amount, C1, C2

Many Thank

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56506

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sort Columns


This is MUCH easier than you might think and doesn't require a macro if
you can believe that!!

First you need to set up a custom list of the column names in the order
you want them to appear sorted in. To do this go to
Tools\Options\Custom Lists. Once you are there enter the column names
in the "List entries" box in the correct sort order separated by a
comma and then click the "Add" button to the right and then the "OK"
button.

Second highlight the columns you want to sort and select Data\Sort when
the Sort dialog box opens select "Options" at the bottom of the dialog
box. In the Sort Options dialog box that opens select the custom list
you just created from the drop down box "First key sort order". Then
click the radio button "Sort left to right" and click "OK".

Now make sure that the "Sort by" drop down box on the "Sort" dialog
says "Row 1" and the "Ascending" radio button next to it is selected.
Click "OK" and your columns are sorted in the order you want them.






T De Villiers Wrote:
Hi,

I have 5 columns with 5000 rows.
Column Headings a
C1, C2, Account, Amount, Type

I need to write a macro which will sort data by Column to:
Account, Type, Amount, C1, C2

Many Thanks



--
Excelenator


------------------------------------------------------------------------
Excelenator's Profile: http://www.excelforum.com/member.php...o&userid=36768
View this thread: http://www.excelforum.com/showthread...hreadid=565069

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort by color: Is there an easy way to sort columns or rows in EX MGP Excel Worksheet Functions 5 August 16th 08 11:28 AM
sort by two columns ends up with wrong sort in 2nd col urbnjckct Excel Discussion (Misc queries) 3 November 2nd 07 01:25 AM
Sort command does not sort some columns? BillyBob New Users to Excel 4 May 11th 06 04:16 PM
How do I sort the data in 8 columns by two of the columns? Sorting Excel Worksheet Functions 1 October 25th 05 03:57 PM
data sort is not including all columns in sort Tracy Excel Discussion (Misc queries) 1 October 4th 05 12:16 AM


All times are GMT +1. The time now is 06:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"