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

Good morning everyone

I hope someone can help me with this. I am trying to filter my worksheet at
2 distinct levels. Firstly, I am trying to sort the workbook in ascending
results in terms of column B. I managed to do this by recording the macro and
got the following code:

Selection.AutoFilter
Range("A1:AE144").Sort Key1:=Range("B1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

However, once the workbook is sorted like this, I would like to further sort
the results in ascending values in terms of Column J. Thus keeping the data
sorted in terms of Column B... but further sorted in terms of Column J.

Really would appreciate the help

Regards

Paul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default 2 level sorting

Never mind, managed to achieve result by using the following:

Cells.Select
Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("O2") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
DataOption2 _
:=xlSortNormal


Thank you though in case you were looking to help

"PVANS" wrote:

Good morning everyone

I hope someone can help me with this. I am trying to filter my worksheet at
2 distinct levels. Firstly, I am trying to sort the workbook in ascending
results in terms of column B. I managed to do this by recording the macro and
got the following code:

Selection.AutoFilter
Range("A1:AE144").Sort Key1:=Range("B1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

However, once the workbook is sorted like this, I would like to further sort
the results in ascending values in terms of Column J. Thus keeping the data
sorted in terms of Column B... but further sorted in terms of Column J.

Really would appreciate the help

Regards

Paul

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
Procedure level array not recognised at module level Numskull Excel Programming 2 May 21st 08 01:52 PM
what is sorting script level tmaxwell Excel Programming 1 May 1st 08 04:51 PM
advance level of sorting data? by Ting Ting Li Excel Worksheet Functions 1 July 17th 07 11:07 AM
Using macro to convert single level BOM to Multi Level BOM andrew_chong Excel Programming 0 February 7th 06 08:57 PM
Why, when I create workbook-level name does it jump it to Sheet-level ? Charles Jordan Excel Programming 1 November 5th 03 08:43 PM


All times are GMT +1. The time now is 11:16 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"