+ Reply to Thread
Results 1 to 2 of 2

Filter in array 2D

Hybrid View

  1. #1
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,433

    Filter in array 2D

    Hello EveryBody Please Help me with use Filter in Array vba
    i have code
    like this
     Sub TESTarray_Filter()
     a_sn = Range("A2", [A10000].End(3)).Value
     a_sp = Filter(Application.Transpose(a_sn), [c2].Value)
     With Sheets(2)
      .UsedRange.ClearContents
      .Cells(1).Resize(UBound(a_sp), 1) = a_sp
     End With
     End Sub
    awwarrr.png

    my code sukses if Array (1d) if only one columns
    now i want use filter with 2d array
    if criteria in C2 and use Filter array vba if meet criteria in col A also in col b copy to sheet2
    this is my code
     Sub TESTarray_Filter2D()
     a_sn = Range("A2", [B10000].End(3)).Value
     a_sp = Application.Index(a_sn, Filter(Application.Transpose(a_sn), [c2].Value), Array(1, 2))
     With Sheets(2)
      .UsedRange.ClearContents
      .Cells(1).Resize(UBound(a_sp), 2) = a_sp
     End With
     End Sub
    but my code is error what is wrong with code please help me use filter

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,157

    Re: Filter in array 2D

    From context help for the "FIlter" function:

    "Syntax: Filter(sourcesrray, match[, include[, compare]])
    Returns a zero-based array containing subset of a string array based on a specified filter criteria
    sourcearray - Required. One-dimensional array of strings to be searched
    An error occurs if sourcearray is Null or is not a one-dimensional array"

    Use some replacement.

+ 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. Array VBA Filter
    By rbirch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2016, 09:20 PM
  2. Use Array to filter column with
    By jeroenv in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-01-2015, 04:32 PM
  3. Replies: 6
    Last Post: 05-26-2012, 04:56 AM
  4. Small if Array K- Use with filter
    By hiker100 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-17-2011, 09:41 AM
  5. filter out the array
    By kaffal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2009, 02:06 PM
  6. Filter an Array
    By ShredDude in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2008, 12:33 PM
  7. VBA - Get array of filter values
    By gary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-10-2006, 08:10 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