Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2003 Sort a range of data, multiple columns & rows 2

Status
Not open for further replies.

rwbob

Programmer
Nov 20, 2008
2
CA
I haven't found a function yet, although it may be simple. I need to sort a set of text values ascending in first column continuing in subsequent columns. The data is restricted to a fixed set of columns and rows.
Although I can copy all values to working column and then sort, I thought there would be an easier way. The worksheet is used as data entry by a clerk who needs to sort but has very little Excel knowledge.

Original data as entered
UV189 LH776 BG543 UV123
PH554 UV190 PH987 PH321
PH123 PH234 PH089 PG876
AS469 PH456 UV132 AS134
BH654 PH345 HS687 GB654

Required Sort
AS134 HS687 PH234 PH987
AS469 LH776 PH321 UV123
BG543 PG876 PH345 UV132
BH654 PH089 PH456 UV189
GB654 PH123 PH554 UV190
 



Hi,

Excel works on tables, which is 1) all the contiguous data, 2) each column is its own data type.

You're looking for what I'd call a 'snake sort'. That is not a feature of Excel, AFAIK.

What that would involve is, 1) copy the data into ONE column, 2) sort that column 3) copy it back, chopping it up to fit the original structure.

You might play around with trying out that process and recording it with your macro recorder. Then post back in forum707, to get help with any VBA problems you might have with customization.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thankyou SkipVought and mscallisto. I've incorporated both of your recommendations. Now that I know that it is a snake or newspaper sort. I went one step further and used the microsoft solution and created the macro 'SortAllRangeData'. Secondly I created another macro to run the Microsoft 'SortAllRangeData' macro. Now I just have to select the range of data and run macro. It doesn't matter what the range is and can vary in size or location. Now I have one macro to sort.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top