+ Reply to Thread
Results 1 to 2 of 2

Advanced Filter Error

  1. #1
    Floyd Bates
    Guest

    Advanced Filter Error


    All:

    When I run this routine with the CopyToRange of A1:J2000, I get the
    following error message:
    Run-time error 1004
    The extract range has a missing or illegal field name.

    When I run it with the CopyToRange set to A1:I2000, it runs without an
    error.

    The problem that I am having is that my data extends across 209 columns
    to HA.

    The code below will only return 9 columns.

    Is there anything that you can see that I am missing?

    'Database range A4:HA1575
    'Criteria G1:H2

    Sub ApplyFilter() 'Move filtered data to activesheet
    Sheets("Orders").Range("Database").AdvancedFilter _
    Action:=xlFilterCopy, _
    CriteriaRange:=Sheets("Orders").Range("Criteria"), _
    CopyToRange:=Range("A1:J2000"), _
    Unique:=False
    End Sub

    Thanks in advance.

    Floyd


  2. #2
    Michael
    Guest

    RE: Advanced Filter Error

    Is your "Database" range the same size than A1:I2000, basically you will have
    to make sure the source and destination ranges are the same size, and that
    the destination is empty.

    "Floyd Bates" wrote:

    >
    > All:
    >
    > When I run this routine with the CopyToRange of A1:J2000, I get the
    > following error message:
    > Run-time error 1004
    > The extract range has a missing or illegal field name.
    >
    > When I run it with the CopyToRange set to A1:I2000, it runs without an
    > error.
    >
    > The problem that I am having is that my data extends across 209 columns
    > to HA.
    >
    > The code below will only return 9 columns.
    >
    > Is there anything that you can see that I am missing?
    >
    > 'Database range A4:HA1575
    > 'Criteria G1:H2
    >
    > Sub ApplyFilter() 'Move filtered data to activesheet
    > Sheets("Orders").Range("Database").AdvancedFilter _
    > Action:=xlFilterCopy, _
    > CriteriaRange:=Sheets("Orders").Range("Criteria"), _
    > CopyToRange:=Range("A1:J2000"), _
    > Unique:=False
    > End Sub
    >
    > Thanks in advance.
    >
    > Floyd
    >
    >


+ 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