Sorting in a defined order

L

Laura

I have some queries on sorting if anyone has some code
that can help would be much appreciated.

1) Don't know if it's possible to get round but I need to
sort by 4 columns. I've got in place code below but really
need futher sorting by Column G also.
Range("A1").Sort _
Key1:=Columns("B"), _
Key2:=Columns("C"), _
Key3:=Columns("F"), _
Order3:=xlDescending, _
Header:=xlYes

2) Column B I would really like to group by categories in
an order defined by me i.e "General" then "Maintenance"
then "Engineering" then ... etc i.e not alphabetically
ascending or descending. The number of rows of data is not
the same with each category. Any new data is always added
to the bottom of the list, but then needs to be sorted
before reporting.

Thanks, Laura
 
B

Bob Phillips

Hi Laura,

1) DO 2 sorts, first by C,F,G and then by B,C,F

2) Cretae a custom list Tools>Options>Custom Lists, and then sort special
Data>Sort>Special

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
L

Laura

Thanks for that, but just a quick query if you know
please, this works well and I've put it into my macro as
code. However will this list work on a network, as when
I've finished I will be placing it on a network to be
accessed by many users? Or is it specific to my machine or
log on account/profile? If it is only related to me do you
know how I can put the list into the code? Your help is
much appreciated

Range("A1").Sort _
Key1:=Columns("B"), _
Key2:=Columns("C"), _
Order2:=xlAscending, _
Key3:=Columns("F"), _
Order3:=xlDescending, _
Header:=xlYes, _
OrderCustom:=6, _ 'this is my custom list
MatchCase:=False, _
Orientation:=xlTopToBottom
 
B

Bob Phillips

HI Laura,

The list is a client side list, so it will be specific to you. You could
always record a macro that does it and then share that macro.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Similar Threads


Top