Filter Usind a Combo Box

  • Thread starter Thread starter rob m
  • Start date Start date
R

rob m

I have a combo box on one worksheet containing a list of peoples names
and another sheet containing order details with the people name.

What I want to do is select the name from the combo box and this will
filter the order worksheet to show only the name selected and delete an
other rows.

I can get it to filter by the sales name using the code below but not
delete the other rows

Sheets("Order Details").Select
Selection.AutoFilter Field:=2, Criteria1:=Worksheets("Orderbook
Splits").Range("AD1").Value

I cannot change the criteria from "=" to "<>" has i get an error
message. Does any one know the code that could do this?

Thanking you in advance.

Rob M
 
Enclose the <> in quotation marks:

Selection.AutoFilter Field:=2, _
Criteria1:="<>" & Worksheets("Orderbook Splits").Range("AD1").Value
 

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

Similar Threads

Macro/VB coding question 3
combo box 2
List Box Forms 3
code error - memory error 2
Combo Box 1
Access Control on subform / combo box requesting parameter 0
Combo Box and Sorting 3
Combo box result text not number 2

Back
Top