+ Reply to Thread
Results 1 to 6 of 6

AutoSort Error

Hybrid View

ukyank AutoSort Error 09-16-2013, 04:21 AM
:) Sixthsense :) Re: AutoSort Error 09-16-2013, 05:28 AM
ukyank Re: AutoSort Error 09-16-2013, 05:31 AM
JosephP Re: AutoSort Error 09-16-2013, 06:20 AM
ukyank Re: AutoSort Error 09-16-2013, 06:30 AM
ukyank Re: AutoSort Error 09-16-2013, 06:37 AM
  1. #1
    Registered User
    Join Date
    03-28-2013
    Location
    Kent, Engmland
    MS-Off Ver
    Excel 2010
    Posts
    15

    AutoSort Error

    Greetings,

    Did some research I found code to create a autosort macro, which should sort of today's date in cell A1, that way I always have the most recent entries at the top of my sheet. It will work fine for a while then all of a sudden it refuses to move the content of cell A5 (the first in the sort) to it's correctly sorted location.


     Range("A5:D200").Sort _
         Key1:=Range("A1"), order1:=xlDescending, Header:=xlGuess, _
         OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
         DataOption1:=xlSortNormal

    Any help would be greatly appreciated

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: AutoSort Error

    Are you running it manually or connected it with any events?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    03-28-2013
    Location
    Kent, Engmland
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: AutoSort Error

    I'm running it from a "save" button in a userform. Sorry I should have put that info from the beginning It was originally in the worksheet_ change event
    Last edited by ukyank; 09-16-2013 at 05:43 AM.

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: AutoSort Error

    do you have a header row? if not, use xlNo instead of xlGuess
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Registered User
    Join Date
    03-28-2013
    Location
    Kent, Engmland
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: AutoSort Error

    Hi Joseph header row? I use row 1 - 4 for other info but my sort key is in A1. I'll give xlNo a try, cheers for the info

  6. #6
    Registered User
    Join Date
    03-28-2013
    Location
    Kent, Engmland
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: AutoSort Error

    JosephP - cheers WORKS GREAT NOW!!!! I got to look up xlNo to understand my error. Cheers again!

+ 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. how to autosort
    By jjenred5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2011, 07:03 PM
  2. VBA autosort
    By danzing87 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-07-2010, 09:36 PM
  3. Autosort
    By criscoduck in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-15-2010, 02:01 PM
  4. Autosort Help
    By JoeVember in forum Excel General
    Replies: 0
    Last Post: 04-30-2009, 06:28 PM
  5. autosort
    By pete in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-25-2006, 06:10 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