+ Reply to Thread
Results 1 to 7 of 7

VBA sort not working

  1. #1
    Registered User
    Join Date
    01-15-2006
    Posts
    46

    VBA sort not working

    Error message is sort method of range class failed. 1004. Failure is in the red text.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    01-15-2006
    Posts
    46

    Re: VBA sort not working

    Recorded Macros and copy/pasted, still no worky.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VBA sort not working

    The code seems to be fine, though split oddly. Replace that line and the one above it with this:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Registered User
    Join Date
    01-15-2006
    Posts
    46

    Re: VBA sort not working

    Thanks JB,

    "The sort reference is not valued. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same or blank."

    is the error message i recieve with that code.

    and iv'e been working on it for an hour with different snippits from all around....

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VBA sort not working

    That error seems to indicate blank cells at the top of your data set.

  6. #6
    Registered User
    Join Date
    01-15-2006
    Posts
    46

    Re: VBA sort not working

    Code replaced with your JB, and resulting workbook at time of error. Thanks in advance for your help.

    Jeremy
    Attached Files Attached Files

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: VBA sort not working

    The code seems to work fine on your sheet.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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