ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort by Manager (https://www.excelbanter.com/excel-programming/281790-sort-manager.html)

chrismania[_10_]

Sort by Manager
 

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/


Tom Ogilvy

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/





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com