Consulting

Results 1 to 5 of 5

Thread: VBA – Array Filter

  1. #1

    VBA – Array Filter

    I’ve created a loop macro which results in the attached summary sheet for each value tested. Prior to the next loop the code currently uses a Data Filter within excel to select only the required lines. The filtered lines are copied and moved to a data summary tab and the Data Filter is released for the next value tested within the loop. The code works but the time associated with the each filter has cause the macro to take 10 or 15 minutes to complete.

    I believe I should be using a filter array to select and copy the data instead of the Data Filter. I’ve researched Array filters but don’t seem to fully fit what I’m trying to solve.

    Thank you so much for your any assistance you can provide.

    Doug

    [VBA]
    Sheets("Trade Limiter").Select
    Columns("A:Q").Select
    Selection.AutoFilter
    ActiveSheet.Range("A:Q").AutoFilter Field:=12, Criteria1:="<>"
    Range("Q1").Select
    Range(Selection, Selection.End(xlToLeft)).Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    ` Sheets("Trade Data").Select
    ActiveSheet.Paste
    [/VBA]
    Attached Files Attached Files

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location

  3. #3
    Ken,

    Thanks for the quick reply - switching over to manual calculation improved the speed to only 3-4 minutes. I'd still love any suggestion as to how to place the data into an array.

    Thanks Again!!

  4. #4
    VBAX Tutor mohanvijay's Avatar
    Joined
    Aug 2010
    Location
    MADURAI
    Posts
    268
    Location
    can you please post the workbook with your code and data?

  5. #5
    Quote Originally Posted by mohanvijay
    can you please post the workbook with your code and data?
    File and code enclosed. Thanks for your help.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •