filter code help

  • Thread starter Thread starter scrabtree
  • Start date Start date
S

scrabtree

Here is a code:

Selection.AutoFilter Field:=18, Criteria1:=Sheets
("Code").Range("J2").Value

This code works fine; however, I need it to filter to
everything that does not equeal Sheets("Code").Range
("J2").Value not everything that equals it?
 
Selection.AutoFilter Field:=18, Criteria1:="<>" & Sheets _
("Code").Range("J2").Value
 
Tom gave you the answer, but remember that you can turn on the macro recorder
before you set up the filter. It will give you the appropriate commands.
 

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

Back
Top