Consulting

Results 1 to 2 of 2

Thread: Multiple Filter

  1. #1
    VBAX Tutor
    Joined
    Oct 2007
    Posts
    210
    Location

    Multiple Filter

    I would like to be able to filter a column by more than 2 requirements.
    (ie column = x, column = y, column = z)
    "The amount of stupid people in the world is God's way of punishing the smart people" - protean_being

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Sub Filter3Conditions()
    Dim mpLastRow As Long

    With ActiveSheet

    mpLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
    .Columns(2).Insert
    .Range("B1").Value = .Range("A1").Value
    .Range("B2").Value = "a"
    .Range("B3").Value = "b"
    .Range("B4").Value = "c"
    .Range("A1").Resize(mpLastRow).AdvancedFilter _
    Action:=xlFilterInPlace, _
    CriteriaRange:=.Range("B1:B4"), Unique:=False
    .Columns(2).Delete
    End With
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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