+ Reply to Thread
Results 1 to 3 of 3

Runtime error 1004 using arrays

  1. #1
    Registered User
    Join Date
    05-13-2011
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007, Excel 2010, Excel 2003
    Posts
    1

    Post Runtime error 1004 using arrays

    Am a little new with VBA programming, and have made a short program to given a simpler interface to using the autofilter function in a worksheet. The program works fine in Excel 2007, however in Excel 2003 the program gives the runtime error 1004 with regard to range.autofilter. The code is as below

    The error while debugging is relating to the array that I have defined.

    Please Login or Register  to view this content.
    Hope the info is sufficient.

    The following line gives the error
    ActiveSheet.Range("$A$1:$G$996").AutoFilter Field:=1, Criteria1:=ShipArray, Operator:=xlFilterValues
    with regard to Criteria1

    Thanks in advance
    Last edited by sonyrajan; 05-14-2011 at 09:23 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Runtime error 1004 using arrays

    Welcome to the forum.

    What line errors?

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Runtime error 1004 using arrays

    Sorry for the delay in responding. When all you do is edit your post, I can't tell from looking at my subscribed threads that you have responded.

    In Excel 2003, you can't use an array to autofilter. You can specify two distinct criteria, joined by And or Or.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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