VBA: Filter Data with Multiple Values

Поделиться
HTML-код
  • Опубликовано: 13 сен 2018
  • #xlFilterVaules #VBA #FilterWithMultipleValues
    In this video you will learn how we can use an excel range as a filter criteria and paste the filtered data on another worksheet.
    Please download this excel dashboard from below given link:
    www.pk-anexcelexpert.com/vba-...
    Purchase our Excel Products:
    www.pk-anexcelexpert.com/prod...
    Visit to learn more:
    Chart and Visualizations: www.pk-anexcelexpert.com/cate...
    VBA Course: www.pk-anexcelexpert.com/vba/
    Download useful Templates: www.pk-anexcelexpert.com/cate...
    Dashboards: www.pk-anexcelexpert.com/exce...
    Watch the best info-graphics and dynamic charts from below link:
    • Dynamic Graphs
    Learn and free download best excel Dashboard template:
    • Excel Dashboards
    Learn Step by Step VBA:
    • VBA Tutorial
    Website:
    www.PK-AnExcelExpert.com
    Facebook:
    / pkan-excel-expert-9748...
    Telegram:
    t.me/joinchat/AAAAAE2OnviiEk5...
    Twitter:
    / priyendra_kumar
    Pinterest:
    / pkanexcelexpert
    Send me your queries on telegram:
    @PKanExcelExpert

Комментарии • 107

  • @elguensamaritano
    @elguensamaritano 4 года назад +3

    this men deserve a very special place on haven, you make a great work thanks

  • @GerryStilton
    @GerryStilton 4 года назад +3

    Just what I needed. Thanks PK! I thought autofilter syntax, the ARRAY was for the Excel formula Array rather than the vba array data structure type. That cleared it up.

  • @craigvoss1468
    @craigvoss1468 5 лет назад +1

    Great job. I always appreciate your videos. Thank you for sharing your knowledge with us.

  • @denverjamesduran2750
    @denverjamesduran2750 4 года назад +2

    Thank you I was searching the whole web for this!

  • @aniketbhalerao8097
    @aniketbhalerao8097 2 года назад +2

    PK thanks a lot, speed is perfect not too slow not too fast, easily explained functions. :)

  • @shahir051
    @shahir051 4 года назад +2

    Dear PK,
    Excellent presentation
    Really helped
    Thank you very much
    Expecting many more videos like this...

  • @cesarsaldana3429
    @cesarsaldana3429 5 лет назад +1

    Its amazing, greetings from mexico

  • @wasifangel
    @wasifangel 5 лет назад +1

    You are an excellent teacher, SIR

  • @tomasvolockis3935
    @tomasvolockis3935 4 года назад +2

    Just what i needed, thank you Sir !

  • @juliussamaniego1741
    @juliussamaniego1741 2 года назад

    Thanks a lot! You have no idea how this video has helped me! Thank you, you're a crack!!

  • @biplabbaishnab3926
    @biplabbaishnab3926 3 года назад +1

    Ended my search on filtering here. Well explained brother, keep going

  • @ahmedal-dossary4386
    @ahmedal-dossary4386 5 лет назад

    Thanks for your video.
    How about filtering data based on selected cells across multiple columns?

  • @hindubrahman768
    @hindubrahman768 3 года назад +1

    Fantastic Work done by you

  • @gregandcindylaporte4479
    @gregandcindylaporte4479 4 года назад

    Hello, your video is very straight to the point and I will use most of the coding. However, i need some help around the Filter table section. I do not want to "hard code" it. I want to Copy a value from one cell on another sheet and paste it on the Auto Filter criteria. Any thoughts or links you may have?

  • @wojciechwisniewski2510
    @wojciechwisniewski2510 5 лет назад

    Thanks for this video

  • @Calabrel
    @Calabrel Год назад

    This VBA script worked great. Thank you for the video.
    Question, if you wanted to invert the filtered data so that you copy/paste the data that isn't listed in your Filter_Criteria_Sh, how would you go about doing that?
    It would be very beneficial to be able to exclude things I want to copy with a list.

  • @erdiaz39
    @erdiaz39 3 года назад +1

    AWESOME PK!!!!!!!!!!!!!! You are my HERO!!!!!!

  • @Pankaj-Verma-
    @Pankaj-Verma- 4 года назад +1

    Thank you for your kind help.

  • @varungupta5594
    @varungupta5594 5 лет назад

    Very good PK..pls also will do with the dynamic list box or drop down..

  • @katarinalabanova7178
    @katarinalabanova7178 4 года назад

    Hi! Thanks for very useful video. I am interested how can I adjust macro to copy filtred range to output without headings (first row)? Could you please advise?

  • @swamydadi5887
    @swamydadi5887 3 года назад +1

    Thanks a lot...
    It Helped me a lot.

  • @nv05
    @nv05 2 года назад +1

    Just wow .bro..thank you

  • @PraveenKumar-lp3vs
    @PraveenKumar-lp3vs 5 лет назад

    Thanks for sharing with us !!
    I have a question related to same autofilter that what we can do if I need data except these multiple criterias?

    • @PraveenKumar-lp3vs
      @PraveenKumar-lp3vs 5 лет назад

      Can we use criteria as =''''& array(''EMP-1'', ''EMP-2'', ''EMP-3'')

  • @trynaru
    @trynaru 5 лет назад

    Thanks PK. Can we have a variable filter say values beginning with J, K and S in VBA. I am able to do it for 2 criteria but not 3.

  • @durgesh91tomar
    @durgesh91tomar 5 лет назад +1

    Great job....

  • @mubaraksyed7836
    @mubaraksyed7836 5 лет назад

    Hi Sir, Thanks for your video's Can you please make a video to run multiple vba macros(more than 4) in one workbook.

  • @ghuskia
    @ghuskia 3 года назад +1

    Excellent.. Thank you.. Please make more of it on vba pivot table

  • @shravanjanagani9216
    @shravanjanagani9216 2 года назад +1

    Thank you❤

  • @maheshnelapati7930
    @maheshnelapati7930 4 года назад

    Hi PK, Excellent video, I have a doubt, I want pass input at a tie from multiple fields of Filter
    _Criteria sheet to data sheet to filter . And the filtered data I want to paste in to Output sheet.Could you please tell me how to do that

  • @l1989
    @l1989 4 года назад

    Thanks 😊☺️

  • @gentle2005phir
    @gentle2005phir 5 лет назад +1

    Great PK

  • @surajdalvi3437
    @surajdalvi3437 2 года назад +1

    That's great 👍

  • @ORANGEPICTURESOFFICIAL
    @ORANGEPICTURESOFFICIAL 5 лет назад +1

    Nice video sir

  • @chinabono8995
    @chinabono8995 5 лет назад +1

    Nice tutorial, Thank You. Can you create a tutorial with decisions tree in VBA?

    • @PKAnExcelExpert
      @PKAnExcelExpert  5 лет назад +1

      Thanks for your valuable feedback. I will definitely try to make such video very soon

  • @hariprasad289
    @hariprasad289 5 лет назад

    Thank you for sharing very useful macro, but we are not able to understand how the dynamic array stored in "Emp_List()". Can you please explain it logically

  • @1668hk
    @1668hk 3 года назад +1

    again well done !

    • @PKAnExcelExpert
      @PKAnExcelExpert  3 года назад

      Thanks for your valuable feedback

    • @1668hk
      @1668hk 3 года назад

      @@PKAnExcelExpert Emp_list(i) = Filter_Criteria_Sh.Range("A" & i + 2)
      can criteria change to contain the string ?

  • @jagritbhagat9529
    @jagritbhagat9529 3 года назад +1

    Very nice video👍

  • @trynaru
    @trynaru 5 лет назад

    Or can we have more than two criterias while applying filter "beginning with"... If that clears my question. Any help is appreciated.

  • @WADiverDave
    @WADiverDave 5 лет назад +1

    Hey - thanks for the tutorial - I have an issue where I need to filter out multiple criteria - is there a way that I can use the Array for to - for your example filter out... EMP1, EMP2, EMP3...? Thanks David

    • @michaelroeder7536
      @michaelroeder7536 5 лет назад +1

      Same Question, would like to filter all items NOT in the group.

    • @enjoyatabc
      @enjoyatabc 4 года назад

      Hi, if you have answer for
      Filter all items not in the group?
      Send to my email ksudhakar2k11@gmail.com

  • @salahlechekhab6433
    @salahlechekhab6433 10 месяцев назад

    hello, thank you , i need filtred by years in output exemple: 2018-2019-2020

  • @minalramteke3748
    @minalramteke3748 5 лет назад

    Hi.... Can you please also tell how to defilter more than 2 criteria using VBA....

  • @btyz16
    @btyz16 4 года назад

    Hi, How can i find the row number of filtered the data ? I want to edit some of filtered cells.

  • @sanjayrawat5298
    @sanjayrawat5298 5 лет назад

    I have a question if emp name (let it is emp-x) in criteria is not listed in data sheet. Then, I want it will skip and continue to look next criteria. what coding I can use for this???

  • @garyallan69
    @garyallan69 5 лет назад +1

    Thank you PK. I always enjoy watching your videos but wouldn’t using an advanced filter be easier?

    • @PKAnExcelExpert
      @PKAnExcelExpert  5 лет назад +1

      Thanks for your valuable feedback. Actually I wanted to tell the use
      of xl filtervalues. I will create another video with using advanced filter

  • @MARQUITOSGUALACBA
    @MARQUITOSGUALACBA 4 года назад

    how can I get the first field in a column after the filter?

  • @upgradetechnicalskills3392
    @upgradetechnicalskills3392 5 лет назад

    Hi sir good evening
    I have one Excel worksheet where the data is more than 5 lakes. In that I have to use filter in three columns like
    1) User ID,
    2) Transect Originator
    3) User name
    Copy that Data open New folder new workbook paste,save close.
    I had made one VBA code which one taking lot of time

  • @RajKumar-dg6kv
    @RajKumar-dg6kv 4 года назад

    I need to filter using data from activecell.. for example if I click a particular cell in sheet 1 that value should be filtered in sheet 2

    • @aur321
      @aur321 4 года назад

      Got how to do that? Have that same issue!!!

  • @ashishagrawal9431
    @ashishagrawal9431 8 месяцев назад

    Thank you. How to restrict only selected column to be copied in Output sheet. I need only few columns in the output. how vba query should be adjusted

  • @birkanal2778
    @birkanal2778 5 месяцев назад

    Hello, can we transfer your work in this video directly to the listbox instead of the page, thank you.

  • @Immortal34345
    @Immortal34345 4 года назад

    Please need your help.. I added ur macros.. But it gives only values with numbers, is there any way to make it get data, numbers text or whatever

  • @VinodKumar-yp8gd
    @VinodKumar-yp8gd 4 года назад

    How to filter based on header name as we are giving autofilter field may be 2 or 3 column numb instead i want to give autofilter field as name ( header name) of the column
    Can u pls help me its a real problem i stuck with as my input data's header kept shuffling often

  • @Andrea-yc2jp
    @Andrea-yc2jp Год назад

    Thanks!
    I have only one problem:
    I have a table where there are empty cells and the filter is hiding all the rows which don't contain the complete data.
    Example:
    In a table with headers "Date, Description, Category, Amount, Notes", when i search "Food" the filter doens't show the rows in which the "Notes" cell is empty.
    How can I make the filter also show me rows with some empty cells?

  • @RajeshwarUma
    @RajeshwarUma 4 года назад

    Ok it's very interesting but I need data sheet another column random values of employees records only that s records only one one copy could help me

  • @srinivasv8842
    @srinivasv8842 3 года назад

    Hi, I am unable to filter using criteria *value using vba. Please share your thoughts am using Excel 2013

  • @asifattar8158
    @asifattar8158 4 года назад

    Thanks PK. I tried the same code. However, ReDim is not working. Run-time error 9. Subscript out of range. Could you please help on this.

  • @Achiuce
    @Achiuce 2 года назад

    how to let VBA allow to return a normal range if the criteria is empty? I'm trying to implement such a system for an entire database. If I don't want to put a criteria under one field. I still want it to return the ones I have inputted cells to. Any help is much appreciated

  • @balukasagani2003
    @balukasagani2003 3 года назад

    instead of all the columns,I want to copy only few columns data from Data tab to output tab, is that possible ?

  • @AniManuSCh
    @AniManuSCh 3 года назад

    How about the criteria being in the same cell?

  • @healthyman01
    @healthyman01 2 года назад

    It works, but it only return 2 values on output when i search for emp1 and emp2.. if i add the 3rd emp3 it clears the output sheet. Any idea wc part of code to fix? Tnx.

  • @Sasha_5M
    @Sasha_5M 3 года назад

    I am searching many times but could not find any relevant videos....now i just wanted to know that you have given criteria only for 3 rows but how we can do it by putting many line items in criteria...will criteria automatically select ? or we need to change the criteria every time ?

  • @surajdalvi3437
    @surajdalvi3437 2 года назад

    Can you please help here, I am not able to copy filter data in output. All data is getting pasted in output sheet. I am using same code

  • @ankit143dolly
    @ankit143dolly 2 года назад

    Hi, M getting error of autofilter method of range class failed. Pl suggest

  • @vignesharulrajs
    @vignesharulrajs 4 месяца назад

    What is Emp_List as per Excel?

  • @cindymesia401
    @cindymesia401 2 года назад

    sir, what if i filter multiple criteria but its just a keyword not the exact word? how would I do that?

  • @maheshnelapati7930
    @maheshnelapati7930 4 года назад

    At a time

  • @rakeshbond009
    @rakeshbond009 4 года назад

    How to filter numbers

  • @chintamanishisode7553
    @chintamanishisode7553 3 года назад

    If one of criteria is not available then it will fail ?

  • @samirstatuscreation3028
    @samirstatuscreation3028 2 года назад

    Hi Sir,
    Me aapka Subscriber Hu muje aapke saare videos ache lge muje aapse ek help chahiye thi
    Aapki is video me hai viase hi muje krna hai bat thodi dikkat aa rahi hai . Muje har ek value ex. Emp ko filetr kar iski kuch values copy krni hai har emp ki alag alg range hogi ex. Kisi emp ki fist 2 to kisi ki 5 aise sabki alag alg par meri define ki huvi range ki value chahiye or ye code har ek emp me run krvana hai
    Sir please help and solve this
    Your Subscriber,
    Samir Kagda

  • @cindymesia401
    @cindymesia401 2 года назад

    Option Explicit
    Sub Filter_Criteria()
    Dim Data_sh As Worksheet
    Dim Filter_Criteria_Sh As Worksheet
    Dim Output_sh As Worksheet
    Set Data_sh = ThisWorkbook.Sheets("Data")
    Set Filter_Criteria_Sh = ThisWorkbook.Sheets("Filter_Criteria")
    Set Output_sh = ThisWorkbook.Sheets("Output")
    Output_sh.UsedRange.Clear
    Data_sh.AutoFilterMode = False
    Dim Emp_list() As String
    Dim n As Integer
    n = Application.WorksheetFunction.CountA(Filter_Criteria_Sh.Range("A:A")) - 2
    ReDim Emp_list(n) As String
    Dim i As Integer
    For i = 0 To n
    Emp_list(i) = Filter_Criteria_Sh.Range("A" & i + 2)
    Next i
    Data_sh.UsedRange.AutoFilter 2, Emp_list(), xlFilterValues
    Data_sh.UsedRange.Copy Filter_Criteria_Sh.Range("c1")
    Data_sh.AutoFilterMode = False
    End Sub

  • @cia120
    @cia120 Год назад

    how criteria is contain , not equal?

    • @PKAnExcelExpert
      @PKAnExcelExpert  Год назад

      Put "*" before and after criteria word

    • @cia120
      @cia120 Год назад

      @@PKAnExcelExpert please show to me where put "*" in syntax.

    • @cia120
      @cia120 Год назад

      @@PKAnExcelExpert please explain sir