PC Review


Reply
 
 
Dave
Guest
Posts: n/a
 
      26th Jun 2009

Hi,
XL2003
Is it possible to sort by a custom list, and have that custom list included
in the code, rather than putting the custom list in the Tools>Options>Custom
Lists?
Something like the following (which generates an error):

Range(Cells(A, 1), Cells(500, 16)).Sort _
Key1:=Range("DueHeader"), Order1:=xlAscending, _
Header:=xlYes, OrderCustom:=("SMT","PCB","FA")

Regards - Dave.
 
Reply With Quote
 
 
 
 
Peter T
Guest
Posts: n/a
 
      26th Jun 2009

One way, without code

Put your custom list in cells somewhere and name as (say) myList
For testing, your items in col-A and assuming the first item to sort is in
A2
=MATCH(A2,myList,0)
and copy down

Sort against the match'd column

Regards,
Peter T


"Dave" <(E-Mail Removed)> wrote in message
news:EBFBF66F-6E6C-47D4-BF08-(E-Mail Removed)...
> Hi,
> XL2003
> Is it possible to sort by a custom list, and have that custom list
> included
> in the code, rather than putting the custom list in the
> Tools>Options>Custom
> Lists?
> Something like the following (which generates an error):
>
> Range(Cells(A, 1), Cells(500, 16)).Sort _
> Key1:=Range("DueHeader"), Order1:=xlAscending, _
> Header:=xlYes, OrderCustom:=("SMT","PCB","FA")
>
> Regards - Dave.



 
Reply With Quote
 
Dave
Guest
Posts: n/a
 
      27th Jun 2009

Hi Peter,
Thanks for the suggestion. But I really want to be able to do this with a
button click.
I have data that I need to be able to sort in a number of different ways,
depending on what we want at the time. I have buttons to sort by date, by
Customer, by Product, and a few others, and I'd like to have a button for the
affore mentioned.
I've tried adding the custom list, but that's only garranteed to work on 1
computer, since we can't predict how many custom lists exist on other
computers, and hence can't predict which number of custom list to call.
Regards - Dave.

"Peter T" wrote:

> One way, without code
>
> Put your custom list in cells somewhere and name as (say) myList
> For testing, your items in col-A and assuming the first item to sort is in
> A2
> =MATCH(A2,myList,0)
> and copy down
>
> Sort against the match'd column
>
> Regards,
> Peter T
>
>
> "Dave" <(E-Mail Removed)> wrote in message
> news:EBFBF66F-6E6C-47D4-BF08-(E-Mail Removed)...
> > Hi,
> > XL2003
> > Is it possible to sort by a custom list, and have that custom list
> > included
> > in the code, rather than putting the custom list in the
> > Tools>Options>Custom
> > Lists?
> > Something like the following (which generates an error):
> >
> > Range(Cells(A, 1), Cells(500, 16)).Sort _
> > Key1:=Range("DueHeader"), Order1:=xlAscending, _
> > Header:=xlYes, OrderCustom:=("SMT","PCB","FA")
> >
> > Regards - Dave.

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding custom list and text boxes to the custom tool bar from Excel C API Mousam Microsoft Excel Discussion 2 8th Aug 2007 07:54 PM
Adding custom list and text boxes to the custom tool bar from Excel C API Mousam Microsoft Excel Misc 0 7th Aug 2007 09:19 AM
Adding custom list and text boxes to the custom tool bar from Excel C API Mousam Microsoft Excel Programming 0 6th Aug 2007 10:05 AM
How to save a list of custom words in a rule to a text file, or to copy the list? Dmitriy Kopnichev Microsoft Outlook Third-Party Utilities 3 26th Jan 2004 06:15 AM
How to save a list of custom words in a rule to a text file, or to copy the list? Dmitriy Kopnichev Microsoft Outlook Discussion 3 26th Jan 2004 06:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:26 PM.