Results 1 to 14 of 14

convert code from filter to loop with array for big data

Threaded View

  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 .
    Sub FilterData()
    Dim tm As Double
    Dim startDate As Long, endDate As Long
    tm = Timer
    startDate = sheet2.Range("C2").Value
    endDate = sheet2.Range("C3").Value
    sheet2.Range("A6").CurrentRegion.ClearContents
    
    With sheet1.UsedRange
        .AutoFilter 1, ">=" & startDate, xlAnd, "<= " & endDate
        .SpecialCells(xlCellTypeVisible).Copy sheet2.[A6]
        .AutoFilter
    End With
    MsgBox Format(Timer - tm, "0.00")
    End Sub
    thanks
    Attached Files Attached Files
    Last edited by MKLAQ; 09-21-2022 at 06:49 AM.

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