• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to filter 'Contains" data by using VBA

ThrottleWorks

Excel Ninja
Hi,

I am trying to filter "Contains" data by VBA.

For example in Column A I want to filter data containing value ABC.
Can anyone help me in this please.

I forgot to mention, I am filtering a string with VBA that is why I am getting confused about how to add contains criteria to the string.
 
Good morning Somendra,

Thanks for the help. I need to use the string.
I am required to filter values from a range, say from A1:A10 and perform actions.

That is why I can not use abc, it may be def or feg in next run.

PS - Please let me know if you need further details.
 
Sir, sorry for making it confusing.

I have Range G2:G3.
I need to find G2 and G in range A1:D9.

I have a loop, which will pick value from G2 and filter data containing "ABC" in range A1:D9.

Next line, loop will pick value of G3 which is DEF and filter data containing DEF in Range A1:D9.

For this I need to use string and filter data "contains".
 

Attachments

  • FilterChandoo.xlsb
    15.5 KB · Views: 23
Hi @NARAYANK991 Sir, Yes ! This is what I was trying to do.

It's working perfect, though I am not able to use MyString in the above mentioned line of yours, I will try to find a workaround this.

But this is what I was trying to do, filter the data "Contains".

Thanks a lot for the help. :)
 
Back
Top