PC Review


Reply
Thread Tools Rate Thread

2 level sorting

 
 
PVANS
Guest
Posts: n/a
 
      5th Aug 2009
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 With Quote
 
 
 
 
PVANS
Guest
Posts: n/a
 
      5th Aug 2009
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
two level make table query and sorting??? tcek Microsoft Access Queries 1 28th May 2010 12:36 AM
what is sorting script level tmaxwell Microsoft Excel Programming 1 1st May 2008 04:51 PM
advance level of sorting data? by Ting =?Utf-8?B?VGluZyBMaQ==?= Microsoft Excel Worksheet Functions 1 17th Jul 2007 11:07 AM
Sorting top level of Favorites Jim Slager Windows XP Internet Explorer 3 23rd Feb 2004 01:55 AM
Epson C82 Stylus printer - Ink level indicator - True level or estimate? Cindg88@nospamhere.com Printers 4 1st Aug 2003 10:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:41 PM.