LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Macro for Multiple Sorts

Using Excel 2000.
We have hundreds of rows of data that look like this:
A B C D E F G
1 Descr 1 hr 2 hrs 3 hrs 4 hrs 5 hrs 6 hrs
2 da 62
3 rf 24
4 aa 6
5 fr 5
6 cd 4
7 as 55
8 xx 14

The workbook has data in every row under column A
and one entry in one column (B-G) for each row.

We want to get a macro to perfrom multiple sorts on the
workbook so that it will look like this when finished:

A B C D E F G
1 Descr 1 hr 2 hrs 3 hrs 4 hrs 5 hrs 6 hrs
2 cd 4
3 fr 5
4 aa 6
5 as 55
6 da 62
7 xx 14
8 rf 24

We want to sort on column B. Then sort on the rest of the
worksheet on cloumn C. Then column D, E, and F.

We got the first part (the easy one) but can't figure out
how to get the macro to go to the next and succeeding
steps. After the first sort, I think that we need for the
macro to look for the first blank row under column B,
range select the rest of the worksheet and sort on C. Then
go to the first blank row under Column C, range select the
rest of the worksheet, and sort on Column D. Etc.

Range("A1").Select
Range(Selection, ActiveCell.SpecialCells
(xlLastCell)).Select
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom

Can someone help us here, please?
 
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
Macro sorts C Brandt Excel Discussion (Misc queries) 5 April 26th 07 11:41 PM
Create a macro that finds values then sorts John Hughes Excel Worksheet Functions 2 August 30th 06 12:10 AM
same range, multiple sheets, different sorts, help please! nikmasteed Excel Worksheet Functions 2 May 19th 06 04:30 PM
Excel gets subtotals out of order using multiple sorts and subtot. jeffl Excel Discussion (Misc queries) 1 March 29th 05 01:35 AM
Macro that sorts Hawkfan757 Excel Worksheet Functions 1 December 2nd 04 02:53 PM


All times are GMT +1. The time now is 01:39 PM.

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

About Us

"It's about Microsoft Excel"