Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-11-2017, 04:37 AM
Debaser's Avatar
Debaser Debaser is offline delete custom lists macro Windows 7 64bit delete custom lists macro Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Location: UK
Posts: 221
Debaser will become famous soon enough
Default

For example:



Code:
    Dim ws As Worksheet
    Set ws = ActiveWorkbook.Worksheets("Sheet1")
    With ws.Sort
        With .SortFields
            .Clear
            .Add Key:=ws.Range("A2:A19"), SortOn:=xlSortOnValues, _
                    Order:=xlAscending, CustomOrder:="h,k,a,d,e", _
                    DataOption:=xlSortNormal
        End With
        .SetRange ws.Range("A1:A19")
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
Just amend the CustomOrder string argument.
Reply With Quote
  #2  
Old 10-12-2017, 12:36 AM
ewso ewso is offline delete custom lists macro Windows 10 delete custom lists macro Office 2016
Advanced Beginner
delete custom lists macro
 
Join Date: Nov 2016
Posts: 80
ewso is on a distinguished road
Default

Debaser...so I would have to type in all the items in my custom list after CustomOrder:?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie - Need help with a macro and drop down lists vipvanilla Word VBA 4 02-13-2014 01:30 PM
Macro to add periods into MAC address lists auriuman78 Word VBA 1 01-29-2014 10:30 AM
delete custom lists macro Cannot delete old 2003 custom menu from 2010 template Smallweed Word 1 10-02-2013 03:53 PM
custom icon, undo/redo for macro, permanent macro Rapier Excel 0 08-05-2013 06:30 AM
delete custom lists macro Delete custom heading styles ubns Word 1 07-31-2012 08:35 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:31 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft