+ Reply to Thread
Results 1 to 5 of 5

Sort Macro Run-time error '1004': Application/Object-defined error.

  1. #1
    Registered User
    Join Date
    06-20-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    10

    Sort Macro Run-time error '1004': Application/Object-defined error.

    Hi,

    I am trying to create a piece of VBA code which sorts some data. However on the one sheet there are multiple sets of data to be sorted in alphabetical order. Data may also be added and removed so I am trying to use variables to set the sort range. Here is the code which I am using:

    Please Login or Register  to view this content.
    The error "Run-time error '1004': Application-defined or object-defined error." appears on the .Apply line.

    If anyone could point me in the right direction it would be appreciated.
    Last edited by sam1212; 08-22-2014 at 10:07 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Sort Macro Run-time error '1004': Application/Object-defined error.

    Can you attach the sheet?
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Registered User
    Join Date
    06-20-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    10

    Re: Sort Macro Run-time error '1004': Application/Object-defined error.

    Quote Originally Posted by nathansav View Post
    Can you attach the sheet?
    I'm afraid I can't as there is a fair bit of company information on it. There isn't much VBA in the sheet though, it's just a few tables underneath one another going from columns A to V, but with varying row lengths.

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Sort Macro Run-time error '1004': Application/Object-defined error.

    You may not use multiple columns as Key for sorting.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  5. #5
    Registered User
    Join Date
    06-20-2014
    Location
    England
    MS-Off Ver
    2010
    Posts
    10

    Re: Sort Macro Run-time error '1004': Application/Object-defined error.

    Quote Originally Posted by Izandol View Post
    You may not use multiple columns as Key for sorting.
    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. excel macro run time error '1004'- Application defined or object defined error
    By kmadan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-16-2014, 09:51 AM
  2. Replies: 1
    Last Post: 03-12-2014, 12:42 PM
  3. [SOLVED] Error " Run-time error '1004': application defined or object defined error
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 07:26 AM
  4. [SOLVED] Macro causes Run time error 1004 Application defined or object-defined error
    By Firefighter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2012, 04:09 AM
  5. Macro - Run-time Error '1004': Application defined or object defined error
    By robby10 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-14-2010, 07:55 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