Sort Macro

N

nc

I recorded this macro to sort a list according to a custom
list. The problem I have is that it does not sort on
another users Excel because they don't have the same
customs list.

Is there a way round this problem?

Sub Macro1()

Columns("N:N").Select
Selection.Sort Key1:=Range("N1"),
Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=12, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub
 
A

AlfD

Hi!

Application.AddCustomList ListArray:=Range("A1:A10") will add a custo
list to a workbook using a range you can specify and fill in advance.

Al
 
A

AlfD

Hi!

If I understand you aright: have a look at the Help file item o
AddCustomList. I think you'll find what you want in the example there.

Al
 
N

nc

Hi Alf

Please help me. I have posted this as a new post but no
one seem to be answering.

Can I put the sort list (Similar to a custom list) in a
macro?

I can use the addcustmlist method to add the list to the
custom lists, the problem is when recording the macro to
sort according to that customlist the code selects the
list according to it's position in the in the custom
lists. This lists might be different in a different order
if run on another users computer.
 

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