SOLVED

VBA Code does not work to filter Data based on the selection form drop down list

%3CLINGO-SUB%20id%3D%22lingo-sub-2583514%22%20slang%3D%22en-US%22%3EVBA%20Code%20does%20not%20work%20to%20filter%20Data%20based%20on%20the%20selection%20form%20drop%20down%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2583514%22%20slang%3D%22en-US%22%3E%3CP%3EI%20tried%20to%20filter%20the%20Data%20of%20the%20Table1%20based%20on%20the%20selection%20of%20two%20dependent%20drop%20down%20list%20using%20a%20simple%20VBA%20code%20described%20as%20follows%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SaremAmmar_0-1627163928114.png%22%20style%3D%22width%3A%20469px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F298192i877F291879FD49DD%2Fimage-dimensions%2F469x127%3Fv%3Dv2%22%20width%3D%22469%22%20height%3D%22127%22%20role%3D%22button%22%20title%3D%22SaremAmmar_0-1627163928114.png%22%20alt%3D%22SaremAmmar_0-1627163928114.png%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SaremAmmar_1-1627163981351.png%22%20style%3D%22width%3A%20588px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F298193i2347C289F777E697%2Fimage-dimensions%2F588x150%3Fv%3Dv2%22%20width%3D%22588%22%20height%3D%22150%22%20role%3D%22button%22%20title%3D%22SaremAmmar_1-1627163981351.png%22%20alt%3D%22SaremAmmar_1-1627163981351.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EHowever%2C%20Filter%20process%20does%20not%20work%20properly.%20The%20result%20stuck%20with%20the%20row%20no.2!%3C%2FP%3E%3CP%3ECould%20you%20please%20help%20me%20with%20this%20problem%3F%3C%2FP%3E%3CP%3EI%20attached%20the%20excel%20file%20as%20a%20reference.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20very%20much!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2583514%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2583796%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20Code%20does%20not%20work%20to%20filter%20Data%20based%20on%20the%20selection%20form%20drop%20down%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2583796%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1111805%22%20target%3D%22_blank%22%3E%40SaremAmmar%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20need%20to%20change%20the%20setup%20slightly.%20The%20criteria%20range%20rows%20should%20not%20intersect%20with%20the%20data%20rows.%3C%2FP%3E%3CP%3EI%20have%20changed%20the%20setup%20in%20the%20attached%20and%20it%20works%20now.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2584977%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20Code%20does%20not%20work%20to%20filter%20Data%20based%20on%20the%20selection%20form%20drop%20down%20list%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2584977%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F394231%22%20target%3D%22_blank%22%3E%40Subodh_Tiwari_sktneer%3C%2FA%3E%3CBR%20%2F%3EMany%20thanks%20for%20your%20swift%20response%20and%20support.%3CBR%20%2F%3EHave%20a%20great%20weekdays!%3C%2FLINGO-BODY%3E
New Contributor

I tried to filter the Data of the Table1 based on the selection of two dependent drop down list using a simple VBA code described as follows:

SaremAmmar_0-1627163928114.pngSaremAmmar_1-1627163981351.png

However, Filter process does not work properly. The result stuck with the row no.2!

Could you please help me with this problem?

I attached the excel file as a reference.

 

Thanks very much!

3 Replies
best response confirmed by SaremAmmar (New Contributor)
Solution

@SaremAmmar 

You need to change the setup slightly. The criteria range rows should not intersect with the data rows.

I have changed the setup in the attached and it works now.

 

@Subodh_Tiwari_sktneer
Many thanks for your swift response and support.
Have a great weekdays!

You're welcome @SaremAmmar! Glad it worked as desired.

Thanks and you too.