+ Reply to Thread
Results 1 to 14 of 14

convert code from filter to loop with array for big data

  1. #1
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    413

    convert code from filter to loop with array for big data

    Hello
    I want changing this code for big data . every time increase data I note code will be slow . currently data are 25000 rows and will increase .
    it will filter between two dates .
    Please Login or Register  to view this content.
    thanks
    Attached Files Attached Files
    Last edited by MKLAQ; 09-21-2022 at 06:49 AM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: convert code from filter to loop with array for big data


    Hello, you must try an advanced filter ...

  3. #3
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    413

    Re: convert code from filter to loop with array for big data

    thanks , that doesn't solve slowness in big data .

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Exclamation Re: convert code from filter to loop with array for big data


    Wrong so you did not ever try it ! I used it with huge data and as your 25K rows are not such big ...
    Last edited by Marc L; 09-20-2022 at 05:49 AM.

  5. #5
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: convert code from filter to loop with array for big data

    Hello.
    I'm not sure you understood that @Marc L's suggestion was to use Advanced Filter instead of AutoFilter.

    In any case, I suggest you look at this method, which is usually efficient:

    Please Login or Register  to view this content.
    Last edited by beyond Excel; 09-20-2022 at 11:38 AM.

  6. #6
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    413

    Re: convert code from filter to loop with array for big data

    @beyond Excel thanks but this gives the same speed , there is no difference.

  7. #7
    Forum Guru Sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2019 | 2021
    Posts
    15,026

    Re: convert code from filter to loop with array for big data

    Upload sample file...
    Good Luck...
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
    Also....Add a comment if you like!!!!
    And remember...Mark Thread as Solved...
    Excel Forum Rocks!!!

  8. #8
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    413

    Re: convert code from filter to loop with array for big data

    @sintek file is big can't upload it

  9. #9
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777
    Quote Originally Posted by MKLAQ View Post
    @sintek file is big can't upload it
    Please upload a workbook with no more than 1000 rows of data to the forum.

  10. #10
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: convert code from filter to loop with array for big data


    Quote Originally Posted by MKLAQ View Post
    @sintek file is big can't upload it
    Save it as binary .xlsb at least, like for the advanced filter ...

  11. #11
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    413

    Re: convert code from filter to loop with array for big data

    OK guys I uploaded file .

  12. #12
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this !


    According to your attachment an Excel basics VBA demonstration as a very beginner starter :

    PHP Code: 
    Sub Demo1()
        [
    A6].CurrentRegion.Clear
        
    [K1:L1] = sheet1.[A1]
        [
    K2:L2].Formula = [{"="">=""&C2","=""<=""&C3"}]
        
    sheet1.[A1].CurrentRegion.Columns("A:Q").AdvancedFilter 2, [K1:L2], [A6]
        [
    K1:L2].Clear
    End Sub 
    ► Do you like it ? ► So thanks to click on bottom left star icon ? Add Reputation ? !

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    31,212

    Re: Try this !

    I did 30K records with the original code: almost instantaneous!
    Last edited by JohnTopley; 09-21-2022 at 10:10 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  14. #14
    Forum Contributor
    Join Date
    02-08-2021
    Location
    africa
    MS-Off Ver
    2016
    Posts
    413

    Re: convert code from filter to loop with array for big data

    thanks Marc L not big difference , but I accept your answering

+ 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. [SOLVED] filter to array not advanced filtering for second loop
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-31-2019, 08:27 AM
  2. change source data br loop each loop in array vba
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2018, 11:21 AM
  3. [SOLVED] Code to filter Sub Array from data set
    By chullan88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-04-2017, 02:41 AM
  4. [SOLVED] Add multiple criteria to auto filter one by one via loop from a range / array
    By Ronnet2 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-08-2016, 07:25 AM
  5. Convert Sumifs to vba code with loop
    By lakamas in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-13-2015, 06:33 PM
  6. Code to Loop through a 2d array
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-03-2013, 06:30 AM
  7. Convert repetitive IF statements to array loop?
    By bntringa in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-27-2006, 05:45 PM

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