Thread: Sort by Manager
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Sort by Manager

The empty rows should sort to the bottom.

Turn on the macro recorder

Select your data, Sort with the two criteria manually

Turn off the macro recorder

Look at the code recorded. That is the code you need.

I get code like this:

Selection.Sort Key1:=Range("B3"), Order1:=xlAscending, Key2:=Range("C3")
_
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=
_
False, Orientation:=xlTopToBottom


--
Regards,
Tom Ogilvy

"chrismania" wrote in message
...

Hi Guys,
I am a beginner in VB.
I have the following problem
A B C
Cust1 Manager1 Date
Cust 2 Manager 2 Date
Cust3 Manager1 Date
...... ........... ........

I want to sort the table by the Manager and then by the Date. Problem
is that some rows are completly empy in the table.
Thanks Guys


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/