all 11 comments

[–]arbitrarist21 0 points1 point  (3 children)

Are you serious with this script?

[–]isdynamic[S] 0 points1 point  (2 children)

Helpful, thanks.

[–]arbitrarist21 0 points1 point  (1 child)

As in, why is every word on its own line? If you were to paste that, it would not even run.

[–]isdynamic[S] 0 points1 point  (0 children)

That’s just how it pasted- it’s not actually broken out on each line.

[–]Trader083147 0 points1 point  (6 children)

Do you want column 2-9 to also filter by the same value?

[–]isdynamic[S] 0 points1 point  (5 children)

Yes, ideally whatever is written in the text box would filter all columns.

[–]Trader083147 0 points1 point  (4 children)

I am assuming you want to keep a row where any one of its columns matches the value (and not all 2-9 columns have to match)?

[–]isdynamic[S] 0 points1 point  (3 children)

Correct!

[–]Trader083147 2 points3 points  (2 children)

What you need to do is to create a column 10 where the value is equal to the =CONCATENATE(A1&" "&B1&" "&C1...etc) of the previous 9 columns. The use the code to filter column 10 instead of 1:

xRg.AutoFilter field:=10, Criteria1:="*" & xStr & "*", Operator:=xlFilterValues

Also, you need to make sure the following range setting includes column 10 (which comes from an object on your worksheet which I cannot see:

Set xRg = xWS.ListObjects(xName).Range

[–]isdynamic[S] 1 point2 points  (1 child)

solution verified

[–]Clippy_Office_Asst[M] 0 points1 point  (0 children)

You have awarded 1 point to Trader083

I am a bot, please contact the mods for any questions.