+ Reply to Thread
Results 1 to 3 of 3

Code For A Custom Sort Using A List On Another Sheet

  1. #1
    Registered User
    Join Date
    12-26-2010
    Location
    Ohio
    MS-Off Ver
    Excel 2003 and 07
    Posts
    16

    Code For A Custom Sort Using A List On Another Sheet

    I posted this on another site but have not got an answer. Maybe this cant be done but can someone look at this code and help me make it work...
    The table to sort range is Sheet1 (day 1) A6:G (number of rows will vary) sort by column A. Custom sort list is on Sheet6 (Sort) I found this code and played with it. It errors at the area in red. I have a project I would love to make this work on, I don't know VBA good enough to make it work. Thanks of you can help....

    [CODE][/Sub Sorting()
    Range("A6:E100").Select
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("A6"), SortOn:=xlSortOnValues, _
    Order:=xlAscending, CustomOrder:="Sort!(A1:A181)", DataOption:=xlSortNormal

    With ActiveWorkbook.Worksheets("Sheet1").Sort
    .SetRange Range("A6:E100")
    .Header = xlNo
    .MatchCase = False
    .Orientation = xlTopToBottom
    .SortMethod = xlPinYin
    .Apply
    End With
    End SubCODE]

    Will this work or maybe have to start over with different code I don't care, I just would like to see it work. THANKS
    Last edited by rockyw; 04-06-2016 at 08:48 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,610

    Re: Code Help For A Project Please

    title updated.
    Last edited by protonLeah; 04-07-2016 at 10:08 PM.
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    12-26-2010
    Location
    Ohio
    MS-Off Ver
    Excel 2003 and 07
    Posts
    16

    Re: Code For A Custom Sort Using A List On Another Sheet

    Done thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Changing VBA Project Name Using VBA Code
    By PosseJohn in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-06-2016, 06:11 PM
  2. Import VBA code to SPECIFIED project
    By VitoBdG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2015, 11:08 AM
  3. [SOLVED] hELP FOR MY PROJECT (IN PROJECT SHEET CODE NOT WORK,, OUTSIDE THAT CODE WORK)
    By santosh226001 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 08-06-2013, 06:53 AM
  4. [SOLVED] Function that concatenates multiple sub-project descriptions based on project code
    By markbpi in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2012, 06:49 PM
  5. Help w/VBA code for project.
    By iThinkDeeply in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-04-2010, 01:00 PM
  6. If i entered any project code in sheet2 display all data of that project
    By koolguys4u in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2009, 03:09 AM
  7. Help - old code inherited with project
    By Sandy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-26-2005, 09:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1