filtering data with a variable

  • Thread starter john.9.williams
  • Start date
J

john.9.williams

i wish to filter a list by using the contains option, but i want to
filter with contains a varible with its cell, then return the filtered
result, cell a only to another part of my sheet, can this be done.

example

Selection.AutoFilter Field:=1, Criteria1:="=*test*", Operator:=xlAnd

i want to replace test with a variable name, I have tried removing the
speech marks but cannot seem to get it right, any help greatly
recieved

johny
 
D

Dave Peterson

Selection.AutoFilter Field:=1, Criteria1:="=*" & yourvariablenamehere & "*"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top