Results 1 to 5 of 5

Filtering in VBA

Threaded View

  1. #1
    Registered User
    Join Date
    10-04-2012
    Location
    Aguascalientes
    MS-Off Ver
    Excel 2003
    Posts
    3

    Filtering in VBA

    I need to be able to filter a list (which I get from an external database) with many filters. The list has in one colum a product code (about 5000 different ones) that repeats as many sales as each salesman made and I need to know who sold what so I made a macro that worked and looked it up in vba but I have a limit on a consult table cause I don't know how to make a string for tha array that will take only the values of the consulting items.

    I speak spanish, sorry if I didn't explain myself very well.

    so greatful for your help

    Luis
    Sub Filtrar3()
    Dim Cadena(0 To 40) As String
    Dim i As Variant
        For i = 5 To Worksheets("Busqueda").Range("a1")
            Cadena(i) = Worksheets("Busqueda").Cells(i, 1).Value
        Next
        
        ActiveSheet.ListObjects("Tabla_MOV001PRIMERA").Range.AutoFilter Field:=1, _
            Criteria1:=Array(Cadena(1), Cadena(2), Cadena(3), Cadena(4), Cadena(5), _
            Cadena(6), Cadena(7), Cadena(8), Cadena(9), Cadena(10), Cadena(11), Cadena(12), _
            Cadena(13), Cadena(14), Cadena(15), Cadena(16), Cadena(17), Cadena(18), Cadena(19), _
            Cadena(20)), Operator:=xlFilterValues
    End Sub
    Last edited by Paul; 10-05-2012 at 12:53 PM. Reason: Added CODE tags for new user. Please do so yourself in the future.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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