+ Reply to Thread
Results 1 to 4 of 4

Adding Auto Sort to my macro

Hybrid View

  1. #1
    Registered User
    Join Date
    04-08-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    6

    Adding Auto Sort to my macro

    Hi,

    I have a macro that automatically adds past due and close to due date information to my immediate attention tab. Please see attached sheet.

    I would like to be able to automatically sort the immediate attention tab by days until due date. What should I add to the macro?

    Thanks for your help.
    Attached Files Attached Files

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Adding Auto Sort to my macro

    One option:

    With Worksheets("Immediate Attention").Sort
        .SortFields.Clear
        .SortFields.Add Key:=Range("G5"), _
        SortOn:=xlsortonvalue, Order:=xlAscending
        .SetRange Range("B5:G1000")
        .Header = xlYes
        .Apply
    End With
    Another:

    Worksheets("Immediate Attention").Range("B5:G1000").Sort Key1:=Range("G5"), Order1:=xlAscending, Header:=xlYes
    Last edited by Arkadi; 07-23-2014 at 03:13 PM.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Adding Auto Sort to my macro

    Also,

        With Sheets("Immediate Attention").Range("B6")
            .CurrentRegion.sort .Offset(, 4), 1, , , , , , xlYes
        End With
    Cheers, berlan

  4. #4
    Registered User
    Join Date
    04-08-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Adding Auto Sort to my macro

    Thanks so much for your help.

+ 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. Auto Sort macro
    By YaSSaL in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2013, 06:23 AM
  2. Auto sort after adding new figures
    By skittler in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-11-2013, 05:12 PM
  3. Auto sort after adding new figures
    By plumbob in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-28-2012, 03:18 AM
  4. [SOLVED] Auto sort with macro
    By magman1984 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2012, 03:30 PM
  5. Auto Sort using Macro
    By Rubix in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-13-2005, 05:30 AM

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