+ Reply to Thread
Results 1 to 4 of 4

Using Array in Auto Filter VBA -Type 13 error - more than 65536 records

  1. #1
    Registered User
    Join Date
    08-05-2014
    Location
    Pune, India
    MS-Off Ver
    2007
    Posts
    12

    Unhappy Using Array in Auto Filter VBA -Type 13 error - more than 65536 records

    I've scoured all over the forums and message boards before posting this...

    So here is my requirement step by step

    1. I have a data in worksheet (240k rows) - each row has a unique transaction id
    2. I need to filter that data with criteria that is selected from a range
    3. For that I have used a For Loop and to construct an array and used that Array to put in auto filter
    So far all good - no problem
    4. Now the problem is that - the range I'm using to make the array and put it the filter has more than 2^16 records [68k records] which is giving me a type mismatch error - and I don't know how to solve it - some suggest transpose or loops but consider me a full novice in transposing and how it works or what it does.


    Below is the code extract

    Please Login or Register  to view this content.



    Thanks,
    Karan
    +* if the post helped!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Using Array in Auto Filter VBA -Type 13 error - more than 65536 records

    Why not use an Avanced Filter and use the data where it exists?
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Using Array in Auto Filter VBA -Type 13 error - more than 65536 records

    It would help if you can upload small sample demonstrating your set up and issue.

    One thing, is that you don't need to use ReDim Preserve...

    Since from your code, it looks like you know the upper bound of the array already (i.e. SH2.Cells(5, 14))

    So you should be able to write...
    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Registered User
    Join Date
    08-05-2014
    Location
    Pune, India
    MS-Off Ver
    2007
    Posts
    12

    Re: Using Array in Auto Filter VBA -Type 13 error - more than 65536 records

    Quote Originally Posted by TMS View Post
    Why not use an Avanced Filter and use the data where it exists?
    Hi,

    Thanks for the quick reply and apologies for my late response.

    So the problem with advanced filter is that it gets stuck --- its really very slow compared to autofilter - Even on mt Surfacebook or Thinkpad it's crashing half the time

    My observations

    Auto Filter:- 9k record filter - 3 seconds
    Auto Filter:- 25k record filter - 5-6 seconds
    Auto Filter:- 60k record filter - 10 seconds max
    Auto Filter:- 68k record filter - error
    Advanced Filter:- 25k records - usually crashes - if resulted goes above 5-6 minutes easy

    Running i5 8GB RAM Surface Book / Thinkpad both

    Advanced Filter observation is same whether I run with macro or using standard feature.

+ 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. Filter array type mismatch
    By stylecrazy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-23-2013, 09:16 AM
  2. Auto updated - filter unique records
    By Jason_2112 in forum Excel General
    Replies: 4
    Last Post: 02-12-2009, 03:47 PM
  3. Auto Filter - Number of records
    By Walldorc in forum Excel General
    Replies: 2
    Last Post: 12-17-2008, 09:06 AM
  4. [SOLVED] Using Excel's Auto Filter, how can I show # of records returned?
    By Jim in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-13-2006, 03:40 PM
  5. [SOLVED] Limit of records when using auto filter
    By JennD in forum Excel General
    Replies: 5
    Last Post: 03-01-2006, 02:15 PM
  6. Array problem: Key words-Variant Array, single-element, type mismatch error
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-09-2005, 01:54 AM
  7. Array problem: Key words-Variant Array, single-element, type mismatch error
    By davidm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2005, 12:30 AM
  8. [SOLVED] Help: Compile error: type mismatch: array or user defined type expected
    By lvcha.gouqizi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-31-2005, 05:05 PM

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