Sort by Manager

C

chrismania

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
 
T

Tom Ogilvy

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top