walter while
walter while

Reputation: 107

Searching for partial text in vba

I have the below VBA code that searches for the exact text in a colum:

Filter3InSummary = Array(Array("AE43", "TT", "I:I", "<>Duplicate TT", _
                                         "G:G", "<>Not Tested", _
                                         "U:U", "Item"))
For Each test In Filter3InSummary
With Worksheets(test(1))
    Range(test(0)) = wf.CountIfs(.Range(test(2)), test(3), _
                                 .Range(test(4)), test(5), _
                                 .Range(test(6)), test(7))

But this code will exactly search for that word.

If the text has for example: "Item tested" instead of "Item", there will be no result show.

How can I modify this to taken in partial words from a cell into consideration (wildcards?

Upvotes: 0

Views: 1323

Answers (1)

Cyril
Cyril

Reputation: 6829

Use the wildcard (asterisk) in your code: "*Item*"

Upvotes: 1

Related Questions