Consulting

Results 1 to 3 of 3

Thread: Search on MULTIPLE column using VBA

  1. #1

    Question Search on MULTIPLE column using VBA

    I've been wondering how to filter data with two columns.

    For example, I ONLY want to filter data that are CS (COURSE) with a GRADE of 900.

    These are the columns.

    |---ID---|---NAME---|---GRADE---|---COURSE---|

    Can you please help me work this out? What should I use for searching? I've used shape as textbox on my recent filter data.

    Thank you!

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Supply a file (a workbook) with the setup and perhaps a bit where you show the result you want.
    At first sight, an autofilter should do the trick.
    Do you want to filter in-place, or to another location?
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Sub Test()
    With ActiveSheet.Range("A:D")
    .AutoFilter 3, 900
    .AutoFilter 4, "CS"
    End With
    End Sub
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

Posting Permissions

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